Class AbstractSendEmail

    • Constructor Detail

      • AbstractSendEmail

        public AbstractSendEmail()
    • Method Detail

      • requiresSmtpSessionInitialization

        public abstract boolean requiresSmtpSessionInitialization()
        Returns whether the SMTP session needs to be initialized.
        true if the SMTP session needs to be initialized
      • initializeSmtpSession

        public abstract 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.
        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
        Exception - if initialization fails
      • sendMail

        public abstract boolean sendMail​(Email email)
                                  throws Exception
        Sends an email.
        email - the email to send
        true if successfully sent
        Exception - in case of invalid internet addresses or messaging problem
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.

        Default implementation does nothing.
        Specified by:
        cleanUp in interface CleanUpHandler