Class SMTPClient


  • public class SMTPClient
    extends Object
    Author:
    susi
    • Field Detail

      • DEFAULT_MAX_SIZE

        public static final long DEFAULT_MAX_SIZE
        31.84 MB smtp.postman.i2p as of 2017-12.
        Since:
        0.9.33
        See Also:
        Constant Field Values
      • BINARY_MAX_SIZE

        public static final long BINARY_MAX_SIZE
        About 23.25 MB. Base64 encodes 57 chars to 76 + \r\n on a line
        Since:
        0.9.33
        See Also:
        Constant Field Values
    • Constructor Detail

      • SMTPClient

        public SMTPClient()
    • Method Detail

      • sendMail

        public boolean sendMail​(String host,
                                int port,
                                String user,
                                String pass,
                                String sender,
                                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