Interface SendEmail

    • Method Detail

      • requiresSmtpSessionInitialization

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

        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

        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