public interface MailMessage
Modifier and Type | Method and Description |
---|---|
MailMessage |
addAttachment(ContentDisposition contentDispostion,
File file)
Adds Attachment to the message
|
MailMessage |
addAttachment(EmailAttachment attachment)
Adds Attachment to the message
|
MailMessage |
addAttachment(String fileName,
String mimeType,
ContentDisposition contentDispostion,
byte[] bytes)
Adds Attachment to the message
|
MailMessage |
addAttachment(String fileName,
String mimeType,
ContentDisposition contentDispostion,
InputStream inputStream)
Adds Attachment to the message
|
MailMessage |
addAttachments(Collection<? extends EmailAttachment> attachments)
Adds a Collection of Attachments to the message
|
MailMessage |
addHeader(String name,
String value)
Add header to the message.
|
MailMessage |
bcc(Collection<? extends EmailContact> emailContacts)
Add collection of BCC (Blind Carbon Copy) recipients
|
MailMessage |
bcc(EmailContact emailContact)
Add BCC recipient
|
MailMessage |
bcc(InternetAddress emailAddress)
Add BCC (Blind Carbon Copy) recipient
|
MailMessage |
bcc(String... address)
Convenience varargs method to add BCC address(es)
|
MailMessage |
bodyHtml(String html)
Sets the body of the message a HTML body represented by the supplied string
|
MailMessage |
bodyHtml(TemplateProvider htmlBody)
Sets the HTML body of the message to the HTML output of the given template
|
MailMessage |
bodyHtmlTextAlt(String html,
String text)
Sets the body of the message to a HTML body with a plain text alternative
|
MailMessage |
bodyHtmlTextAlt(TemplateProvider htmlBody,
TemplateProvider textBody)
Sets the body of the message to a HTML body with a plain text alternative output of the given templates
|
MailMessage |
bodyText(String text)
Sets the body of the message a plan text body represented by the supplied string
|
MailMessage |
bodyText(TemplateProvider textBody)
Sets the text body of the message to the plain text output of the given template
|
MailMessage |
cc(Collection<? extends EmailContact> emailContacts)
Add collection of CC (Carbon Copy) recipients
|
MailMessage |
cc(EmailContact emailContact)
Add CC recipient
|
MailMessage |
cc(InternetAddress emailAddress)
Add CC (Carbon Copy) recipient
|
MailMessage |
cc(String... address)
Convenience varargs method to add CC address(es)
|
MailMessage |
contentType(ContentType contentType)
Set the Content Type of the message
|
MailMessage |
deliveryReceipt(String address)
Request a delivery receipt "Return-Receipt-To" to the given address
|
MailMessage |
from(Collection<? extends EmailContact> emailContacts)
Adds a Collection of
EmailContact as FROM addresses |
MailMessage |
from(EmailContact emailContact)
Adds a From Address
|
MailMessage |
from(InternetAddress emailAddress)
Adds a From Address
|
MailMessage |
from(String... address)
Convenience varargs method to add FROM address(es)
|
EmailMessage |
getEmailMessage()
Get the
EmailMessage representing this MailMessage |
MailMessage |
iCal(String htmlSummary,
byte[] bytes)
Used for creating iCal Calendar Invites.
|
MailMessage |
importance(MessagePriority messagePriority)
Sets the importance level of the message with a given
MessagePriority |
EmailMessage |
mergeTemplates()
Merge the templates with the context
|
MailMessage |
messageId(String messageId)
Set the Message-ID for the message.
|
MailMessage |
put(Map<String,Object> values)
Places a Map of variable in the templating engines context
|
MailMessage |
put(String name,
Object value)
Places a variable in the templating engines context
|
MailMessage |
readReceipt(String address)
Request a read receipt "Disposition-Notification-To" to a given address
|
MailMessage |
replyTo(Collection<? extends EmailContact> emailContacts)
Adds a Collection of
EmailContact as REPLY-TO addresses |
MailMessage |
replyTo(EmailContact emailContact)
Adds a REPLY-TO Address
|
MailMessage |
replyTo(InternetAddress emailAddress)
Adds a REPLY-TO Address
|
MailMessage |
replyTo(String... address)
Convenience varargs method to add REPLY-TO address(es)
|
EmailMessage |
send()
Send the Message using a default mail session created from a configured MailConfig
|
EmailMessage |
send(MailConfig mailConfig)
Send the Message using a JavaMail session created from this specific MailConfig
|
EmailMessage |
send(MailTransporter mailTransporter)
Send the Message
|
EmailMessage |
send(Session session)
Send the Message using a specific JavaMail session
|
void |
setEmailMessage(EmailMessage emailMessage)
Set the
EmailMessage representing this MailMessage |
void |
setMailTransporter(MailTransporter mailTransporter)
Optionally set a MailTransporter will will be used with the default send() method
|
MailMessage |
subject(String value)
Set the subject on the message
|
MailMessage |
subject(TemplateProvider subject)
Set the template to be used for the message subject
|
MailMessage |
to(Collection<? extends EmailContact> emailContacts)
Convenience method to add a TO recipients
|
MailMessage |
to(EmailContact emailContact)
Add TO recipient
|
MailMessage |
to(InternetAddress emailAddress)
Add TO recipient
|
MailMessage |
to(String... address)
Convenience varargs method to add TO address(es)
|
MailMessage from(String... address)
address
- Address of the recipient eq "john.doe@example.com" or "John DoeInvalidAddressException
- if address(es) are in an invalid formatMailMessage from(InternetAddress emailAddress)
emailAddress
- InternetAddress
of the address to be addedMailMessage from(EmailContact emailContact)
emailContact
- EmailContact
of the address to be addedMailMessage from(Collection<? extends EmailContact> emailContacts)
EmailContact
as FROM addressesemailContacts
- Collection of EmailContact
to be addedMailMessage replyTo(String... address)
address
- Address of the recipient eq "john.doe@example.com" or "John DoeInvalidAddressException
- if address(es) are in an invalid formatMailMessage replyTo(InternetAddress emailAddress)
emailAddress
- InternetAddress
of the address to be addedMailMessage replyTo(EmailContact emailContact)
emailContact
- EmailContact
of the address to be addedMailMessage replyTo(Collection<? extends EmailContact> emailContacts)
EmailContact
as REPLY-TO addressesemailContacts
- Collection of EmailContact
to be addedMailMessage addHeader(String name, String value)
name
- Header namevalue
- Header valueMailMessage to(String... address)
address
- Address of the recipient eq "john.doe@example.com" or "John DoeInvalidAddressException
- if address(es) are in an invalid formatMailMessage to(InternetAddress emailAddress)
emailAddress
- InternetAddress
of the address to be addedMailMessage to(EmailContact emailContact)
emailContact
- EmailContact
of the address to be addedMailMessage to(Collection<? extends EmailContact> emailContacts)
emailContacts
- Collection of EmailContact
to be addedMailMessage cc(String... address)
address
- Address of the recipient eq "john.doe@example.com" or "John DoeInvalidAddressException
- if address(es) are in an invalid formatMailMessage cc(InternetAddress emailAddress)
emailAddress
- InternetAddress
of the address to be addedMailMessage cc(EmailContact emailContact)
emailContact
- EmailContact
of the address to be addedMailMessage cc(Collection<? extends EmailContact> emailContacts)
emailContacts
- Collection of EmailContact
to be addedMailMessage bcc(String... address)
address
- Address of the recipient eq "john.doe@example.com" or "John DoeInvalidAddressException
- if address(es) are in an invalid formatMailMessage bcc(InternetAddress emailAddress)
emailAddress
- InternetAddress
of the address to be addedMailMessage bcc(EmailContact emailContact)
emailContact
- EmailContact
of the address to be addedMailMessage bcc(Collection<? extends EmailContact> emailContacts)
emailContacts
- Collection of EmailContact
to be addedMailMessage addAttachment(EmailAttachment attachment)
attachment
- EmailAttachment
to be addedMailMessage addAttachments(Collection<? extends EmailAttachment> attachments)
attachments
- MailMessage addAttachment(String fileName, String mimeType, ContentDisposition contentDispostion, byte[] bytes)
fileName
- mimeType
- contentDispostion
- bytes
- MailMessage addAttachment(String fileName, String mimeType, ContentDisposition contentDispostion, InputStream inputStream)
fileName
- mimeType
- contentDispostion
- inputStream
- MailMessage addAttachment(ContentDisposition contentDispostion, File file)
contentDispostion
- file
- MailMessage importance(MessagePriority messagePriority)
MessagePriority
messagePriority
- The priority level of the message.MailMessage deliveryReceipt(String address)
address
- Email address the receipt should be sent toInvalidAddressException
- if address is in invalid formatMailMessage readReceipt(String address)
address
- Email address the receipt should be sent toInvalidAddressException
- if address is in invalid formatMailMessage messageId(String messageId)
messageId
- MailMessage iCal(String htmlSummary, byte[] bytes)
htmlSummary
- Summary of the invite to be displayed in the body of the email messages.bytes
- iCal data which will be attached to the messageMailMessage subject(String value)
value
- Subject of the messageMailMessage bodyText(String text)
text
- Plain text bodyMailMessage bodyHtml(String html)
html
- HTML bodyMailMessage bodyHtmlTextAlt(String html, String text)
html
- HTML bodytext
- Plain text bodyMailMessage contentType(ContentType contentType)
contentType
- EmailMessage getEmailMessage()
EmailMessage
representing this MailMessage
EmailMessage
representing this MailMessage
void setEmailMessage(EmailMessage emailMessage)
EmailMessage
representing this MailMessage
void setMailTransporter(MailTransporter mailTransporter)
mailTransporter
- EmailMessage mergeTemplates()
EmailMessage
representing this MailMessage
after mergingEmailMessage send(MailTransporter mailTransporter)
mailTransporter
- MailTransporter
instance to used to send the MailMessage
EmailMessage
which represents the MailMessage
as sentSendFailedException
- If the messages fails to be sent.EmailMessage send(Session session)
session
- Session
to use to send the MailMessage
EmailMessage
which represents the MailMessage
as sentSendFailedException
- If the messages fails to be sent.EmailMessage send(MailConfig mailConfig)
mailConfig
- MailConfig
to use to send the MailMessage
EmailMessage
which represents the MailMessage
as sentSendFailedException
- If the messages fails to be sent.EmailMessage send()
EmailMessage
which represents the MailMessage
as sentSendFailedException
- If the messages fails to be sent.MailMessage subject(TemplateProvider subject)
subject
- TemplateProvider
to useTemplatingException
MailMessage bodyText(TemplateProvider textBody)
textBody
- TemplateProvider
to useTemplatingException
MailMessage bodyHtml(TemplateProvider htmlBody)
htmlBody
- TemplateProvider
to useTemplatingException
MailMessage bodyHtmlTextAlt(TemplateProvider htmlBody, TemplateProvider textBody)
htmlBody
- TemplateProvider
to use for HTML portion of messagetextBody
- TemplateProvider
to use for Text alternative portion of messageTemplatingException
MailMessage put(String name, Object value)
name
- Reference name of the objectvalue
- the Object being placed in the contextMailMessage put(Map<String,Object> values)
values
- MapCopyright © 2012 Seam Framework. All Rights Reserved.