i2p.susi.webmail.smtp

## Class SMTPClient

- java.lang.Object
- - i2p.susi.webmail.smtp.SMTPClient

-     public class SMTPClient
      extends Object

  SMTP client for sending email through SMTP servers over I2P. Supports command pipelining, attachments, and size limits optimized for I2P. Includes base64 size calculations and 8BITMIME support for efficient I2P mail delivery.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `BINARY_MAX_SIZE` 7629902 ~= 7.27 MB Base64 encodes 57 chars to 76 + \r\n on a line
    `static long` | `DEFAULT_MAX_SIZE` 10.00 MB smtp.postman.i2p as of 2024-06-22.
    `String` | `error`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SMTPClient()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `sendMail(String host, int port, String user, String pass, String sender, List<String> recipients, StringBuilder body, List<Attachment> attachments, String boundary)`
    `static void` | `writeMail(Writer out, StringBuilder body, List<Attachment> attachments, String boundary)` Caller must close out

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### BINARY_MAX_SIZE

          public static final long BINARY_MAX_SIZE

      7629902 ~= 7.27 MB Base64 encodes 57 chars to 76 + \r\n on a line
      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_SIZE

          public static final long DEFAULT_MAX_SIZE

      10.00 MB smtp.postman.i2p as of 2024-06-22.
      See Also:
        Constant Field Values

    - #### error

          public String error

  - ### Constructor Detail

    - #### SMTPClient

          public SMTPClient()

  - ### Method Detail

    - #### sendMail

          public boolean sendMail(String host,
                                  int port,
                                  String user,
                                  String pass,
                                  String sender,
                                  List<String> recipients,
                                  StringBuilder body,
                                  List<Attachment> attachments,
                                  String boundary)

      Parameters:
        `body` - headers and body, without the attachments
        `attachments` - may be null
        `boundary` - non-null if attachments is non-null
      Returns:
        success

    - #### writeMail

          public static void writeMail(Writer out,
                                       StringBuilder body,
                                       List<Attachment> attachments,
                                       String boundary)
                                throws IOException

      Caller must close out
      Parameters:
        `body` - headers and body, without the attachments
        `attachments` - may be null
        `boundary` - non-null if attachments is non-null
      Throws:
        `IOException`