@PublicAPI(stability=VOLATILE, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class EMailMessage extends Object
| Constructor and Description |
|---|
EMailMessage(String sender,
List<String> recipients,
String subject)
Creates a new e-mail message with the provided information.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttachment(javax.mail.internet.MimeBodyPart attachment)
Adds the provided attachment to this mail message.
|
void |
addAttachment(String attachmentText)
Adds an attachment to this mail message with the provided text.
|
void |
addRecipient(String recipient)
Adds the specified recipient to this message.
|
void |
appendToBody(String text)
Appends the provided text to the body of this message.
|
List<javax.mail.internet.MimeBodyPart> |
getAttachments()
Retrieves the set of attachments for this message.
|
org.forgerock.i18n.LocalizableMessageBuilder |
getBody()
Retrieves the body for this message.
|
String |
getBodyMIMEType()
Retrieves the MIME Type for the body of this message.
|
List<String> |
getRecipients()
Retrieves the set of recipients for this message.
|
String |
getSender()
Retrieves the sender for this message.
|
String |
getSubject()
Retrieves the subject for this message.
|
static void |
main(String[] args)
Provide a command-line mechanism for sending an e-mail message via SMTP.
|
void |
send()
Attempts to send this message to the intended recipient(s).
|
void |
setBody(org.forgerock.i18n.LocalizableMessage body)
Specifies the body for this message.
|
void |
setBody(org.forgerock.i18n.LocalizableMessageBuilder body)
Specifies the body for this message.
|
void |
setBodyMIMEType(String bodyMIMEType)
Specifies the MIME Type for the body of this message.
|
void |
setRecipients(ArrayList<String> recipients)
Specifies the set of recipients for this message.
|
void |
setSender(String sender)
Specifies the sender for this message.
|
void |
setSubject(String subject)
Specifies the subject for this message.
|
public EMailMessage(String sender, List<String> recipients, String subject)
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.public String getSender()
public void setSender(String sender)
sender - The sender for this message.public List<String> getRecipients()
public void setRecipients(ArrayList<String> recipients)
recipients - The set of recipients for this message.public void addRecipient(String recipient)
recipient - The recipient to add to this message.public String getSubject()
public void setSubject(String subject)
subject - The subject for this message.public String getBodyMIMEType()
public void setBodyMIMEType(String bodyMIMEType)
bodyMIMEType - The MIME Type for this message.public org.forgerock.i18n.LocalizableMessageBuilder getBody()
public void setBody(org.forgerock.i18n.LocalizableMessageBuilder body)
body - The body for this message.public void setBody(org.forgerock.i18n.LocalizableMessage body)
body - The body for this message.public void appendToBody(String text)
text - The text to append to the body of the message.public List<javax.mail.internet.MimeBodyPart> getAttachments()
public void addAttachment(javax.mail.internet.MimeBodyPart attachment)
attachment - The attachment to add to this mail message.public void addAttachment(String attachmentText) throws javax.mail.MessagingException
attachmentText - The text to include in the attachment.javax.mail.MessagingException - If there is a problem of some type with the
attachment.public void send()
throws javax.mail.MessagingException
javax.mail.MessagingException - If a problem occurred while attempting to send
the message.public static void main(String[] args)
args - The command-line arguments provided to this program.Copyright © 2010-2020 Wren Security. All Rights Reserved.