Class ApacheSendEmail

    • Field Detail

      • m_Client

        protected transient org.apache.commons.net.smtp.SMTPClient m_Client
        the SMTP client.
      • m_Server

        protected String m_Server
        the server to connect to.
      • m_Port

        protected int m_Port
        the server port.
      • m_UseTLS

        protected boolean m_UseTLS
        whether to use TLS.
      • m_Protocols

        protected String m_Protocols
        the protocols to use.
      • m_UseSSL

        protected boolean m_UseSSL
        whether to use SSL.
      • m_Timeout

        protected int m_Timeout
        the timeout for the server.
      • m_RequiresAuth

        protected boolean m_RequiresAuth
        whether authentication is required.
      • m_User

        protected String m_User
        the user to use for authenticating.
      • m_Password

        protected BasePassword m_Password
        the password to use for authentication.
    • Constructor Detail

      • ApacheSendEmail

        public ApacheSendEmail()
    • Method Detail

      • requiresSmtpSessionInitialization

        public boolean requiresSmtpSessionInitialization()
        Returns whether the SMTP session needs to be initialized.
        Specified by:
        requiresSmtpSessionInitialization in class AbstractSendEmail
        Returns:
        true if the SMTP session needs to be initialized
      • initializeSmtpSession

        public void initializeSmtpSession​(String server,
                                          int port,
                                          boolean useTLS,
                                          boolean useSSL,
                                          int timeout,
                                          boolean requiresAuth,
                                          String user,
                                          BasePassword pw,
                                          String protocols)
                                   throws Exception
        Initializes the SMTP session.
        Specified by:
        initializeSmtpSession in class AbstractSendEmail
        Parameters:
        server - the SMTP server
        port - the SMTP port
        useTLS - whether to use TLS
        useSSL - whether to use SSL
        timeout - the timeout
        requiresAuth - whether authentication is required
        user - the SMTP user
        pw - the SMTP password
        protocols - the protocols to use, empty for default
        Throws:
        Exception - if initialization fails
      • sendMail

        public boolean sendMail​(Email email)
                         throws Exception
        Sends an email.
        Specified by:
        sendMail in class AbstractSendEmail
        Parameters:
        email - the email to send
        Returns:
        true if successfully sent
        Throws:
        Exception - in case of invalid internet addresses or messaging problem