Class EmailSession


  • public class EmailSession
    extends java.lang.Object
    This class represents a raw email session, without any protection from threads waiting on sockets, etc.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String password  
      protected int port  
      protected java.util.Properties properties  
      protected java.lang.String server  
      protected java.lang.String username  
    • Constructor Summary

      Constructors 
      Constructor Description
      EmailSession​(java.lang.String server, int port, java.lang.String username, java.lang.String password, java.util.Properties properties)
      Create a session
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkConnection()  
      void close()  
      void send​(java.util.List<java.lang.String> to, java.lang.String from, java.lang.String subject, java.lang.String body)  
      • Methods inherited from class java.lang.Object

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

      • server

        protected final java.lang.String server
      • port

        protected final int port
      • username

        protected final java.lang.String username
      • password

        protected final java.lang.String password
      • properties

        protected final java.util.Properties properties
    • Constructor Detail

      • EmailSession

        public EmailSession​(java.lang.String server,
                            int port,
                            java.lang.String username,
                            java.lang.String password,
                            java.util.Properties properties)
                     throws javax.mail.MessagingException
        Create a session
        Throws:
        javax.mail.MessagingException
    • Method Detail

      • checkConnection

        public void checkConnection()
                             throws javax.mail.MessagingException
        Throws:
        javax.mail.MessagingException
      • send

        public void send​(java.util.List<java.lang.String> to,
                         java.lang.String from,
                         java.lang.String subject,
                         java.lang.String body)
                  throws javax.mail.MessagingException
        Throws:
        javax.mail.MessagingException
      • close

        public void close()
                   throws javax.mail.MessagingException
        Throws:
        javax.mail.MessagingException