public class Mail extends Object implements Serializable
| Constructor and Description |
|---|
Mail()
Constructs a new empty Mail instance
|
| Modifier and Type | Method and Description |
|---|---|
Mail |
bcc(javax.mail.internet.InternetAddress bcc)
Adds an email address as
bcc recipient.Calling this method multiple times adds multiple bcc addresses to the email. |
Mail |
bcc(String bcc) |
Mail |
cc(javax.mail.internet.InternetAddress cc)
Adds an email address as
cc recipient.Calling this method multiple times adds multiple cc addresses to the email. |
Mail |
cc(String cc) |
Mail |
from(javax.mail.internet.InternetAddress from)
Adds an email address as sender.
Calling this method overwrites any value for the from field set previously. |
Mail |
from(String from) |
Mail |
to(javax.mail.internet.InternetAddress to)
Adds an email address as
to recipient.Calling this method multiple times adds multiple to addresses to the email. |
Mail |
to(String to) |
String |
toString() |
Mail |
withHtml(String html) |
Mail |
withSubject(String subject) |
Mail |
withText(String txt) |
public Mail from(javax.mail.internet.InternetAddress from)
from field set previously.from - a valid, non-null InternetAddressthis Mail instance, to allow for method chainingIllegalArgumentException - if argument is nullpublic Mail from(String from)
from - a valid, non-blank String that can be parsed as InternetAddressthis Mail instance, to allow for method chainingIllegalArgumentException - if argument is not a legal email addressfrom(InternetAddress)public Mail to(javax.mail.internet.InternetAddress to)
to recipient.to addresses to the email.
It does not overwrite previously set addresses.to - a valid, non-null InternetAddressthis Mail instance, to allow for method chainingIllegalArgumentException - if argument is nullpublic Mail to(String to)
to - a valid, non-blank String that can be parsed as InternetAddressthis Mail instanceIllegalArgumentException - if argument is not a legal email addressto(InternetAddress)public Mail cc(javax.mail.internet.InternetAddress cc)
cc recipient.cc addresses to the email.
It does not overwrite previously set addresses.cc - a valid, non-null InternetAddressthis Mail instance, to allow for method chainingIllegalArgumentException - if argument is nullpublic Mail cc(String cc)
cc - a valid, non-blank String that can be parsed as InternetAddressthis Mail instanceIllegalArgumentException - if argument is not a legal email addresscc(InternetAddress)public Mail bcc(javax.mail.internet.InternetAddress bcc)
bcc recipient.bcc addresses to the email.
It does not overwrite previously set addresses.bcc - a valid, non-null InternetAddressthis Mail instance, to allow for method chainingIllegalArgumentException - if argument is nullpublic Mail bcc(String bcc)
bcc - a valid, non-blank String that can be parsed as InternetAddressthis Mail instanceIllegalArgumentException - if argument is not a legal email addressbcc(InternetAddress)public Mail withSubject(String subject)
subject - a String (no restrictions)this Mail instance, to allow for method chainingpublic Mail withText(String txt)
txt - a String (no restrictions)this Mail instance, to allow for method chainingpublic Mail withHtml(String html)
html - a String (no restrictions)this Mail instance, to allow for method chainingCopyright © 2015. All rights reserved.