Package org.opends.server.util
Class EMailMessage
- java.lang.Object
-
- org.opends.server.util.EMailMessage
-
@PublicAPI(stability=VOLATILE, mayInstantiate=true, 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EMailMessage.MimeTextSubType
The MIME text subtype for the message body.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
sendEmailMessage(Set<javax.mail.Session> mailServerSessions, String sender, Set<String> recipients, String subject, EMailMessage.MimeTextSubType mimeTextSubType, CharSequence body)
Attempts to send this message to the intended recipient(s).
-
-
-
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 emailsender
- 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.
-
-