Interface MailServer

  • All Known Implementing Classes:
    MailServerImpl, MicrosoftRestMailServer

    @SupportedAll
    public interface MailServer
    Pluggable interface for all email sending in OpenAM. Can be configured on a per-realm or global basis via the forgerockMailServerImplClassName attribute of the Email Service.

    The implementation must provide a constructor taking a single String argument, which is the name of the realm that service is being constructed for.

    • Method Detail

      • sendHtmlEmail

        void sendHtmlEmail​(String to,
                           String subject,
                           String message)
                    throws javax.mail.MessagingException
        Sends an email message, containing HTML, using default MailServer settings.
        Parameters:
        to - The address that the E-mail message is sent.
        subject - The E-mail subject.
        message - The content contained in the E-mail message.
        Throws:
        javax.mail.MessagingException - in the case where the module was unable to send the e-mail.
      • sendHtmlEmail

        void sendHtmlEmail​(String from,
                           String to,
                           String subject,
                           String message,
                           Map<String,​Set<String>> options)
                    throws javax.mail.MessagingException
        Sends an email message, containing HTML, using specified options given for the MailServer settings.
        Parameters:
        from - The address that sends the E-mail message.
        to - The address that the E-mail message is sent.
        subject - The E-mail subject.
        message - The content contained in the E-mail message.
        options - SMTPHostName, SMTPPort, SMTPUser, SMTPUserPassword.
        Throws:
        javax.mail.MessagingException - in case where the module was unable to send the e-mail.
      • sendEmail

        void sendEmail​(String from,
                       String to,
                       String subject,
                       String message,
                       Map<String,​Set<String>> options)
                throws javax.mail.MessagingException
        Sends an email message using specified options given for the MailServer settings
        Parameters:
        from - The address that sends the E-mail message
        to - The address that the E-mail message is sent
        subject - The E-mail subject
        message - The content contained in the E-mail message
        options - SMTPHostName, SMTPPort, SMTPUser, SMTPUserPassword
        Throws:
        javax.mail.MessagingException - in case where the module was unable to send the e-mail
      • sendEmail

        void sendEmail​(String to,
                       String subject,
                       String message)
                throws javax.mail.MessagingException
        Sends an email message using default MailServer settings
        Parameters:
        to - The address that the E-mail message is sent
        subject - The E-mail subject
        message - The content contained in the E-mail message
        Throws:
        javax.mail.MessagingException - in the case where the module was unable to send the e-mail
      • sendEmail

        void sendEmail​(String to,
                       String subject,
                       String message,
                       String mimeType)
                throws javax.mail.MessagingException
        Sends an email message using default MailServer settings.
        Parameters:
        to - the address that the email message is sent
        subject - the E-mail subject
        message - the content contained in the email message
        mimeType - the mime type to be used for the email
        Throws:
        javax.mail.MessagingException - in the case where the module was unable to send the email