Interface EMailMessage
-
@NotExtensible @ThreadSafety(level=INTERFACE_NOT_THREADSAFE) public interface EMailMessage
This interface defines a set of methods that may be used to interact with a multi-part email message, which may include either or both a plain-text or HTML-formatted body, and may optionally include attachments.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<EMailAttachment>
getAttachments()
Retrieves the list of attachments for this email message.java.util.Set<java.lang.String>
getBCCAddresses()
Retrieves the set of "bcc" recipients for this email message.java.util.Set<java.lang.String>
getCCAddresses()
Retrieves the set of "cc" recipients for this email message.java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getCustomHeaders()
Retrieves a map of the custom headers that should be included in the email message.java.lang.String
getHTMLPart()
Retrieves the HTML-formatted part for this email message, if defined.java.lang.String
getPlainTextPart()
Retrieves the plain-text part for this email message, if defined.java.lang.String
getReplyToAddress()
Retrieves the reply-to address for this email message, if defined.java.lang.String
getSenderAddress()
Retrieves the sender address for this email message.java.lang.String
getSubject()
Retrieves the subject for this email message.java.util.Set<java.lang.String>
getToAddresses()
Retrieves the set of "to" recipients for this email message.void
send()
Attempts to send this message using the server's default SMTP connection pool.java.lang.String
toString()
Retrieves a string representation for this email message.
-
-
-
Method Detail
-
getSenderAddress
java.lang.String getSenderAddress()
Retrieves the sender address for this email message.- Returns:
- The sender address for this email message.
-
getReplyToAddress
java.lang.String getReplyToAddress()
Retrieves the reply-to address for this email message, if defined.- Returns:
- The reply-to address for this email message, or
null
if none is defined.
-
getToAddresses
java.util.Set<java.lang.String> getToAddresses()
Retrieves the set of "to" recipients for this email message.- Returns:
- The set of "to" recipients for this email message, or an empty set if there are none.
-
getCCAddresses
java.util.Set<java.lang.String> getCCAddresses()
Retrieves the set of "cc" recipients for this email message.- Returns:
- The set of "cc" recipients for this email message, or an empty set if there are none.
-
getBCCAddresses
java.util.Set<java.lang.String> getBCCAddresses()
Retrieves the set of "bcc" recipients for this email message.- Returns:
- The set of "bcc" recipients for this email message, or an empty set if there are none.
-
getSubject
java.lang.String getSubject()
Retrieves the subject for this email message.- Returns:
- The subject for this email message.
-
getPlainTextPart
java.lang.String getPlainTextPart()
Retrieves the plain-text part for this email message, if defined.- Returns:
- The plain-text part for this email message, or
null
if none is defined.
-
getHTMLPart
java.lang.String getHTMLPart()
Retrieves the HTML-formatted part for this email message, if defined.- Returns:
- The HTML-formatted part for this email message, or
null
if none is defined.
-
getCustomHeaders
java.util.Map<java.lang.String,java.util.List<java.lang.String>> getCustomHeaders()
Retrieves a map of the custom headers that should be included in the email message.- Returns:
- A map of the custom headers that should be included in the email message.
-
getAttachments
java.util.List<EMailAttachment> getAttachments()
Retrieves the list of attachments for this email message.- Returns:
- The list of attachments for this email message, or an empty list if there are none.
-
send
void send() throws javax.mail.MessagingException
Attempts to send this message using the server's default SMTP connection pool.- Throws:
javax.mail.MessagingException
- If a problem is encountered while trying to send the message.
-
toString
java.lang.String toString()
Retrieves a string representation for this email message.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation for this email message.
-
-