Class AbstractSendEmail

    • Constructor Detail

      • AbstractSendEmail

        public AbstractSendEmail()
    • Method Detail

      • requiresSmtpSessionInitialization

        public abstract boolean requiresSmtpSessionInitialization()
        Returns whether the SMTP session needs to be initialized.
        Returns:
        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.
        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 abstract boolean sendMail​(Email email)
                                  throws Exception
        Sends an email.
        Parameters:
        email - the email to send
        Returns:
        true if successfully sent
        Throws:
        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