Class SmtpMailSender

  • All Implemented Interfaces:
    MailSender

    public class SmtpMailSender
    extends java.lang.Object
    implements MailSender
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] argv)  
      void sendMail​(java.lang.String from, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.lang.String body)
      cc and bcc may be null.
      void sendMail​(java.lang.String from, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.lang.String body, java.lang.String enc)
      cc and bcc may be null.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SmtpMailSender

        public SmtpMailSender​(java.net.InetAddress hostAddr,
                              int port)
      • SmtpMailSender

        public SmtpMailSender​(java.net.InetAddress hostAddr)
      • SmtpMailSender

        public SmtpMailSender​(java.lang.String host,
                              int port)
                       throws java.net.UnknownHostException
        Throws:
        java.net.UnknownHostException
      • SmtpMailSender

        public SmtpMailSender​(java.lang.String host)
                       throws java.net.UnknownHostException
        Throws:
        java.net.UnknownHostException
    • Method Detail

      • sendMail

        public void sendMail​(java.lang.String from,
                             java.lang.String[] to,
                             java.lang.String[] cc,
                             java.lang.String[] bcc,
                             java.lang.String subject,
                             java.lang.String body,
                             java.lang.String enc)
                      throws java.io.IOException,
                             ProtocolException,
                             java.io.UnsupportedEncodingException
        Description copied from interface: MailSender
        cc and bcc may be null.
        Specified by:
        sendMail in interface MailSender
        Throws:
        java.io.IOException
        ProtocolException
        java.io.UnsupportedEncodingException
      • sendMail

        public void sendMail​(java.lang.String from,
                             java.lang.String[] to,
                             java.lang.String[] cc,
                             java.lang.String[] bcc,
                             java.lang.String subject,
                             java.lang.String body)
                      throws java.io.IOException,
                             ProtocolException
        Description copied from interface: MailSender
        cc and bcc may be null. Uses the default encoding...
        Specified by:
        sendMail in interface MailSender
        Throws:
        java.io.IOException
        ProtocolException
      • main

        public static void main​(java.lang.String[] argv)