Class EMailMessage


  • @PublicAPI(stability=VOLATILE,
               mayInstantiate=true,
               mayExtend=false,
               mayInvoke=true)
    public final class EMailMessage
    extends Object
    This class defines an e-mail message that may be sent to one or more recipients via SMTP. This is a wrapper around JavaMail to make this process more convenient and fit better into the Directory Server framework.
    • Method Detail

      • sendEmailMessage

        public static void sendEmailMessage​(Set<javax.mail.Session> mailServerSessions,
                                            String sender,
                                            Set<String> recipients,
                                            String subject,
                                            EMailMessage.MimeTextSubType mimeTextSubType,
                                            CharSequence body)
                                     throws javax.mail.MessagingException
        Attempts to send this message to the intended recipient(s). This will use the mail server(s) defined in the Directory Server mail handler configuration. If multiple servers are specified and the first is unavailable, then the other server(s) will be tried before returning a failure to the caller.
        Parameters:
        mailServerSessions - The sessions to use to send the email
        sender - The address of the sender for the message.
        recipients - The addresses of the recipients for the message.
        subject - The subject to use for the message.
        mimeTextSubType - The message will be sent with this MIME text sub type.
        body - The body for this message
        Throws:
        javax.mail.MessagingException - If a problem occurred while attempting to send the message.