public class EmailPopulatingBuilder extends Object
Email
instances. An instance of this builder can only be obtained through one of the builder
starters on EmailBuilder
.
NOTE: for some reason, JavaDoc is not able to parse all @link
directives used in this class' documentation. I have no idea why, if you can figure
it out, please let me know!
Modifier and Type | Method and Description |
---|---|
EmailPopulatingBuilder |
appendText(String text)
Appends text to the current plain text body (or starts it if plain text body is missing).
|
EmailPopulatingBuilder |
appendTextHTML(String textHTML)
Appends HTML text to the current HTML text body (or starts it if HTML text body is missing).
|
EmailPopulatingBuilder |
bcc(Collection<Recipient> recipients)
Delegates to
#withRecipients(Collection, RecipientType) with Message.RecipientType.BCC . |
EmailPopulatingBuilder |
bcc(javax.mail.internet.InternetAddress address)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.BCC and empty default name. |
EmailPopulatingBuilder |
bcc(Recipient... recipients)
Delegates to
#withRecipients(Collection, RecipientType) with Message.RecipientType.BCC . |
EmailPopulatingBuilder |
bcc(String oneOrMoreAddresses)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.BCC and empty default name. |
EmailPopulatingBuilder |
bcc(String name,
Collection<String> oneOrMoreAddressesEach)
Alias for
bccWithFixedName(String, Collection) . |
EmailPopulatingBuilder |
bcc(String name,
javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
|
EmailPopulatingBuilder |
bcc(String name,
javax.mail.internet.InternetAddress address)
|
EmailPopulatingBuilder |
bcc(String name,
String... oneOrMoreAddressesEach)
Alias for
bccWithFixedName(String, String...) . |
EmailPopulatingBuilder |
bcc(String name,
String address)
Alias for
bccWithFixedName(String, String...) . |
EmailPopulatingBuilder |
bccAddresses(Collection<String> oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.BCC and empty default name. |
EmailPopulatingBuilder |
bccAddresses(String name,
Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
|
EmailPopulatingBuilder |
bccAddressesWithDefaultName(String name,
Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.BCC . |
EmailPopulatingBuilder |
bccAddressesWithDefaultName(String name,
javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.BCC . |
EmailPopulatingBuilder |
bccAddressesWithFixedName(String name,
Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
Delegates to
#withAddressesWithFixedName(String, Collection, RecipientType) with Message.RecipientType.BCC . |
EmailPopulatingBuilder |
bccAddressesWithFixedName(String name,
javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
Delegates to
#withAddressesWithFixedName(String, Collection, RecipientType) with Message.RecipientType.BCC . |
EmailPopulatingBuilder |
bccMultiple(javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.BCC and empty default name. |
EmailPopulatingBuilder |
bccMultiple(String... oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.BCC and empty default name. |
EmailPopulatingBuilder |
bccMultipleAddresses(Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.BCC and empty default name. |
EmailPopulatingBuilder |
bccWithDefaultName(String name,
Collection<String> oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.BCC . |
EmailPopulatingBuilder |
bccWithDefaultName(String name,
String... oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.BCC . |
EmailPopulatingBuilder |
bccWithFixedName(String name,
Collection<String> oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithFixedName(String, Collection, RecipientType) with Message.RecipientType.BCC . |
EmailPopulatingBuilder |
bccWithFixedName(String name,
String... oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithFixedName(String, Collection, RecipientType) with Message.RecipientType.BCC . |
Email |
buildEmail()
Delegates to
Email.Email(EmailPopulatingBuilder) with this as argument. |
EmailPopulatingBuilder |
cc(Collection<Recipient> recipients)
Delegates to
#withRecipients(Collection, RecipientType) with Message.RecipientType.CC . |
EmailPopulatingBuilder |
cc(javax.mail.internet.InternetAddress address)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.CC and empty default name. |
EmailPopulatingBuilder |
cc(Recipient... recipients)
Delegates to
#withRecipients(Collection, RecipientType) with Message.RecipientType.CC . |
EmailPopulatingBuilder |
cc(String oneOrMoreAddresses)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.CC and empty default name. |
EmailPopulatingBuilder |
cc(String name,
Collection<String> oneOrMoreAddressesEach)
Alias for
ccWithFixedName(String, Collection) . |
EmailPopulatingBuilder |
cc(String name,
javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
|
EmailPopulatingBuilder |
cc(String name,
javax.mail.internet.InternetAddress address)
|
EmailPopulatingBuilder |
cc(String name,
String... oneOrMoreAddressesEach)
Alias for
ccWithFixedName(String, String...) . |
EmailPopulatingBuilder |
cc(String name,
String address)
Alias for
ccWithFixedName(String, String...) . |
EmailPopulatingBuilder |
ccAddresses(Collection<String> oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.CC and empty default name. |
EmailPopulatingBuilder |
ccAddresses(String name,
Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
Alias for
ccAddressesWithFixedName(String, Collection) . |
EmailPopulatingBuilder |
ccAddressesWithDefaultName(String name,
Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.CC . |
EmailPopulatingBuilder |
ccAddressesWithDefaultName(String name,
javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.CC . |
EmailPopulatingBuilder |
ccAddressesWithFixedName(String name,
Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
Delegates to
#withAddressesWithFixedName(String, Collection, RecipientType) with Message.RecipientType.CC . |
EmailPopulatingBuilder |
ccAddressesWithFixedName(String name,
javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
Delegates to
#withAddressesWithFixedName(String, Collection, RecipientType) with Message.RecipientType.CC . |
EmailPopulatingBuilder |
ccMultiple(javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.CC and empty default name. |
EmailPopulatingBuilder |
ccMultiple(String... oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.CC and empty default name. |
EmailPopulatingBuilder |
ccMultipleAddresses(Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.CC and empty default name. |
EmailPopulatingBuilder |
ccWithDefaultName(String name,
Collection<String> oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.CC . |
EmailPopulatingBuilder |
ccWithDefaultName(String name,
String... oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.CC . |
EmailPopulatingBuilder |
ccWithFixedName(String name,
Collection<String> oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithFixedName(String, Collection, RecipientType) with Message.RecipientType.CC . |
EmailPopulatingBuilder |
ccWithFixedName(String name,
String... oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithFixedName(String, Collection, RecipientType) with Message.RecipientType.CC . |
EmailPopulatingBuilder |
clearAttachments()
Resets
attachments to empty. |
EmailPopulatingBuilder |
clearBounceTo()
Resets
bounceToRecipient to empty. |
EmailPopulatingBuilder |
clearDispositionNotificationTo()
Resets
dispositionNotificationTo to empty. |
EmailPopulatingBuilder |
clearDkim()
Resets all dkim properties to empty.
|
EmailPopulatingBuilder |
clearEmbeddedImages()
Resets
embeddedImages to empty. |
EmailPopulatingBuilder |
clearFromRecipient()
Resets
fromRecipient to empty. |
EmailPopulatingBuilder |
clearHeaders()
Resets
headers to empty. |
EmailPopulatingBuilder |
clearHTMLText()
Resets
textHTML to empty. |
EmailPopulatingBuilder |
clearId()
Resets
id to empty. |
EmailPopulatingBuilder |
clearPlainText()
Resets
text to empty. |
EmailPopulatingBuilder |
clearRecipients()
Resets
recipients to empty. |
EmailPopulatingBuilder |
clearReplyTo()
Resets
replyToRecipient to empty. |
EmailPopulatingBuilder |
clearReturnReceiptTo()
Resets
returnReceiptTo to empty. |
EmailPopulatingBuilder |
clearSubject()
Resets
subject to empty. |
EmailPopulatingBuilder |
fixingMessageId(String id)
Sets optional ID to a fixed value, which is otherwise generated by the underlying JavaMail framework when sending the email.
|
EmailPopulatingBuilder |
from(javax.mail.internet.InternetAddress fromAddress)
Delegates to
from(Recipient) with a new Recipient wrapped around the given email address. |
EmailPopulatingBuilder |
from(Recipient recipient)
Sets the address of the sender of this email with given
Recipient (ignoring its Message.RecipientType if provided). |
EmailPopulatingBuilder |
from(String fromAddress)
Delegates to
from(String, String) with empty name. |
EmailPopulatingBuilder |
from(String fixedName,
javax.mail.internet.InternetAddress fromAddress)
Delegates to
from(Recipient) with a new Recipient wrapped around the given fixed name and email address. |
EmailPopulatingBuilder |
from(String name,
String fromAddress)
Delegates to
from(Recipient) with a new Recipient wrapped around the given name and email address. |
List<AttachmentResource> |
getAttachments() |
Recipient |
getBounceToRecipient() |
Recipient |
getDispositionNotificationTo() |
File |
getDkimPrivateKeyFile() |
InputStream |
getDkimPrivateKeyInputStream() |
String |
getDkimSelector() |
String |
getDkimSigningDomain() |
javax.mail.internet.MimeMessage |
getEmailToForward() |
List<AttachmentResource> |
getEmbeddedImages() |
Recipient |
getFromRecipient() |
Map<String,String> |
getHeaders() |
String |
getId() |
List<Recipient> |
getRecipients() |
Recipient |
getReplyToRecipient() |
Recipient |
getReturnReceiptTo() |
String |
getSubject() |
String |
getText() |
String |
getTextHTML() |
boolean |
isUseDispositionNotificationTo() |
boolean |
isUseReturnReceiptTo() |
EmailPopulatingBuilder |
prependText(String text)
Prepends text to the current plain text body (or starts it if plain text body is missing).
|
EmailPopulatingBuilder |
prependTextHTML(String textHTML)
Prepends HTML text to the current HTML text body (or starts it if HTML text body is missing).
|
EmailPopulatingBuilder |
signWithDomainKey(byte[] dkimPrivateKey,
String signingDomain,
String dkimSelector)
Delegates to
signWithDomainKey(InputStream, String, String) with a ByteArrayInputStream wrapped around the prodived dkimPrivateKey data. |
EmailPopulatingBuilder |
signWithDomainKey(File dkimPrivateKeyFile,
String signingDomain,
String dkimSelector)
As
signWithDomainKey(InputStream, String, String) , but with a File reference that is later read as InputStream . |
EmailPopulatingBuilder |
signWithDomainKey(InputStream dkimPrivateKeyInputStream,
String signingDomain,
String dkimSelector)
Primes this email for signing with a DKIM domain key.
|
EmailPopulatingBuilder |
signWithDomainKey(String dkimPrivateKey,
String signingDomain,
String dkimSelector)
Delegates to
signWithDomainKey(InputStream, String, String) with a ByteArrayInputStream wrapped around the prodived dkimPrivateKey string converted to UTF_8 byte array. |
EmailPopulatingBuilder |
to(Collection<Recipient> recipients)
Delegates to
#withRecipients(Collection, RecipientType) with Message.RecipientType.TO . |
EmailPopulatingBuilder |
to(javax.mail.internet.InternetAddress address)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.TO and empty default name. |
EmailPopulatingBuilder |
to(Recipient... recipients)
Delegates to
#withRecipients(Collection, RecipientType) with Message.RecipientType.TO . |
EmailPopulatingBuilder |
to(String oneOrMoreAddresses)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.TO and empty default name. |
EmailPopulatingBuilder |
to(String name,
Collection<String> oneOrMoreAddressesEach)
Alias for
toWithFixedName(String, Collection) . |
EmailPopulatingBuilder |
to(String name,
javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
|
EmailPopulatingBuilder |
to(String name,
javax.mail.internet.InternetAddress address)
|
EmailPopulatingBuilder |
to(String name,
String... oneOrMoreAddressesEach)
Alias for
toWithFixedName(String, String...) . |
EmailPopulatingBuilder |
to(String name,
String address)
Alias for
toWithFixedName(String, String...) . |
EmailPopulatingBuilder |
toAddresses(String name,
Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
Alias for
toAddressesWithFixedName(String, Collection) . |
EmailPopulatingBuilder |
toAddressesWithDefaultName(String name,
Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.TO . |
EmailPopulatingBuilder |
toAddressesWithDefaultName(String name,
javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.TO . |
EmailPopulatingBuilder |
toAddressesWithFixedName(String name,
Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
Delegates to
#withAddressesWithFixedName(String, Collection, RecipientType) with Message.RecipientType.TO . |
EmailPopulatingBuilder |
toAddressesWithFixedName(String name,
javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
Delegates to
#withAddressesWithFixedName(String, Collection, RecipientType) with Message.RecipientType.TO . |
EmailPopulatingBuilder |
toMultiple(Collection<String> oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.TO and empty default name. |
EmailPopulatingBuilder |
toMultiple(javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.TO and empty default name. |
EmailPopulatingBuilder |
toMultiple(String... oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.TO and empty default name. |
EmailPopulatingBuilder |
toMultipleAddresses(Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
Delegates to
#withAddressesWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.TO and empty default name. |
EmailPopulatingBuilder |
toWithDefaultName(String name,
Collection<String> oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.TO . |
EmailPopulatingBuilder |
toWithDefaultName(String name,
String... oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithDefaultName(String, Collection, RecipientType) with Message.RecipientType.TO . |
EmailPopulatingBuilder |
toWithFixedName(String name,
Collection<String> oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithFixedName(String, Collection, RecipientType) with Message.RecipientType.TO . |
EmailPopulatingBuilder |
toWithFixedName(String name,
String... oneOrMoreAddressesEach)
Delegates to
#withRecipientsWithFixedName(String, Collection, RecipientType) with Message.RecipientType.TO . |
EmailPopulatingBuilder |
withAddresses(String name,
boolean fixedName,
Collection<javax.mail.internet.InternetAddress> addresses,
javax.mail.Message.RecipientType recipientType)
Delegates to
#withRecipient(String, String, RecipientType) for each address in the provided collection. |
EmailPopulatingBuilder |
withAddressesWithDefaultName(String defaultName,
Collection<javax.mail.internet.InternetAddress> addresses,
javax.mail.Message.RecipientType recipientType)
Delegates to
#withAddresses(String, boolean, Collection, RecipientType) , leaving existing names in tact and defaulting when missing. |
EmailPopulatingBuilder |
withAddressesWithFixedName(String fixedName,
Collection<javax.mail.internet.InternetAddress> addresses,
javax.mail.Message.RecipientType recipientType)
Delegates to
#withAddresses(String, boolean, Collection, RecipientType) , assigning or overwriting existing names with the provided. |
EmailPopulatingBuilder |
withAttachment(String name,
byte[] data,
String mimetype)
Delegates to
withAttachment(String, DataSource) , with a named ByteArrayDataSource created using the provided name, data and
mimetype. |
EmailPopulatingBuilder |
withAttachment(String name,
DataSource filedata)
Adds an attachment to the email message, which will be shown in the email client as seperate files available for download or inline display if
the client supports it (for example, most browsers these days display PDF's in a popup).
|
EmailPopulatingBuilder |
withAttachments(List<AttachmentResource> attachments)
Delegates to
withAttachment(String, DataSource) for each attachment. |
EmailPopulatingBuilder |
withBounceTo(javax.mail.internet.InternetAddress bounceToAddress)
Delegates to
withBounceTo(Recipient) with a new Recipient wrapped around the given address. |
EmailPopulatingBuilder |
withBounceTo(Recipient recipient)
Sets the bounceTo address of this email with given
Recipient (ignoring its Message.RecipientType if provided). |
EmailPopulatingBuilder |
withBounceTo(String bounceToAddress)
Delegates to
withBounceTo(Recipient) with a new Recipient wrapped around the email address (or null if missing). |
EmailPopulatingBuilder |
withBounceTo(String name,
javax.mail.internet.InternetAddress bounceToAddress)
Delegates to
withBounceTo(Recipient) with a new Recipient wrapped around the given fixed name and address. |
EmailPopulatingBuilder |
withBounceTo(String name,
String bounceToAddress)
Delegates to
withBounceTo(Recipient) with a new Recipient wrapped around the given name and email address. |
EmailPopulatingBuilder |
withDispositionNotificationTo()
Indicates that we want to use the NPM flag
dispositionNotificationTo . |
EmailPopulatingBuilder |
withDispositionNotificationTo(javax.mail.internet.InternetAddress address)
Delegates to
withDispositionNotificationTo(Recipient) with a new Recipient wrapped around the provided address. |
EmailPopulatingBuilder |
withDispositionNotificationTo(Recipient recipient)
Indicates the this email should use the NPM flag "Disposition-Notification-To" with the given
preconfigred
Recipient . |
EmailPopulatingBuilder |
withDispositionNotificationTo(String address)
Delegates to
withDispositionNotificationTo(Recipient) with a new Recipient wrapped around the provided address. |
EmailPopulatingBuilder |
withDispositionNotificationTo(String fixedName,
javax.mail.internet.InternetAddress address)
Delegates to
withDispositionNotificationTo(Recipient) with a new Recipient wrapped around the provided fixed name and address. |
EmailPopulatingBuilder |
withDispositionNotificationTo(String name,
String address)
Delegates to
withDispositionNotificationTo(Recipient) with a new Recipient wrapped around the provided name and address. |
EmailPopulatingBuilder |
withEmbeddedImage(String name,
byte[] data,
String mimetype)
Delegates to
withEmbeddedImage(String, DataSource) , with a named ByteArrayDataSource created using the provided name, data and
mimetype. |
EmailPopulatingBuilder |
withEmbeddedImage(String name,
DataSource imagedata)
Adds image data to this email that can be referred to from the email HTML body.
|
EmailPopulatingBuilder |
withEmbeddedImages(List<AttachmentResource> embeddedImages)
Delegates to
withEmbeddedImage(String, DataSource) for each embedded image. |
EmailPopulatingBuilder |
withHeader(String name,
Object value)
Adds a header to the
headers list. |
<T> EmailPopulatingBuilder |
withHeaders(Map<String,T> headers)
Delegates to
withHeader(String, Object) for each header in the provided Map . |
EmailPopulatingBuilder |
withHTMLText(String textHTML)
Sets the optional email message body in HTML text.
|
EmailPopulatingBuilder |
withPlainText(String text)
Sets the optional email message body in plain text.
|
EmailPopulatingBuilder |
withRecipient(Recipient recipient)
Adds a new
Recipient instance as copy of the provided recipient (copying name, address and Message.RecipientType ). |
EmailPopulatingBuilder |
withRecipient(String singleAddress,
javax.mail.Message.RecipientType recipientType)
Delegates to
#withRecipient(String, String, RecipientType) with the name omitted. |
EmailPopulatingBuilder |
withRecipient(String name,
String singleAddress,
javax.mail.Message.RecipientType recipientType)
Adds a new
Recipient instance with the given name, address and Message.RecipientType . |
EmailPopulatingBuilder |
withRecipients(Collection<Recipient> recipients)
Delegates to
#withRecipients(Collection, RecipientType) with Message.RecipientType left empty (so it will use the original values). |
EmailPopulatingBuilder |
withRecipients(Collection<Recipient> recipients,
javax.mail.Message.RecipientType fixedRecipientType)
Delegates to
#withRecipient(String, String, RecipientType) for each recipient in the provided collection, optionally fixing the
recipientType for all recipients to the provided type. |
EmailPopulatingBuilder |
withRecipients(Recipient... recipients)
Delegates to
#withRecipients(Collection, RecipientType) with Message.RecipientType left empty (so it will use the original values). |
EmailPopulatingBuilder |
withRecipients(String name,
boolean fixedName,
Collection<String> oneOrMoreAddressesEach,
javax.mail.Message.RecipientType recipientType)
Delegates to
withRecipient(Recipient) for each address found in not just the collection, but also in every individual address string. |
EmailPopulatingBuilder |
withRecipients(String name,
boolean fixedName,
javax.mail.Message.RecipientType recipientType,
String... oneOrMoreAddressesEach)
Delegates to
#withRecipients(String, boolean, Collection, RecipientType) . |
EmailPopulatingBuilder |
withRecipientsWithDefaultName(String defaultName,
Collection<String> oneOrMoreAddressesEach,
javax.mail.Message.RecipientType recipientType)
Delegates to
#withRecipients(String, boolean, Collection, RecipientType) , leaving existing names in tact and defaulting when missing. |
EmailPopulatingBuilder |
withRecipientsWithDefaultName(String name,
javax.mail.Message.RecipientType recipientType,
String... oneOrMoreAddressesEach)
Delegates to
#withRecipients(String, boolean, Collection, RecipientType) . |
EmailPopulatingBuilder |
withRecipientsWithFixedName(String fixedName,
Collection<String> oneOrMoreAddressesEach,
javax.mail.Message.RecipientType recipientType)
Delegates to
#withRecipients(String, boolean, Collection, RecipientType) , assigning or overwriting existing names with the provided. |
EmailPopulatingBuilder |
withRecipientsWithFixedName(String name,
javax.mail.Message.RecipientType recipientType,
String... oneOrMoreAddressesEach)
Delegates to
#withRecipients(String, boolean, Collection, RecipientType) . |
EmailPopulatingBuilder |
withReplyTo(javax.mail.internet.InternetAddress replyToAddress)
Delegates to
withReplyTo(Recipient) with a new Recipient wrapped around the given address. |
EmailPopulatingBuilder |
withReplyTo(Recipient recipient)
Sets the replyTo address of this email with given
Recipient (ignoring its Message.RecipientType if provided). |
EmailPopulatingBuilder |
withReplyTo(String replyToAddress)
Delegates to
withReplyTo(Recipient) with a new Recipient wrapped around the given email address (or null if missing). |
EmailPopulatingBuilder |
withReplyTo(String fixedName,
javax.mail.internet.InternetAddress replyToAddress)
Delegates to
withReplyTo(Recipient) with a new Recipient wrapped around the given fixed name and address. |
EmailPopulatingBuilder |
withReplyTo(String fixedName,
String replyToAddress)
Delegates to
withReplyTo(Recipient) with a new Recipient wrapped around the given fixed name and email address. |
EmailPopulatingBuilder |
withReturnReceiptTo()
Indicates that we want to use the flag
returnReceiptTo . |
EmailPopulatingBuilder |
withReturnReceiptTo(javax.mail.internet.InternetAddress address)
Delegates to
withReturnReceiptTo(Recipient) with a new Recipient wrapped around the provided address. |
EmailPopulatingBuilder |
withReturnReceiptTo(Recipient recipient)
Indicates that this email should use the RRT flag "Return-Receipt-To" with the
preconfigured
Recipient . |
EmailPopulatingBuilder |
withReturnReceiptTo(String address)
Delegates to
withReturnReceiptTo(Recipient) with a new Recipient wrapped around the provided address. |
EmailPopulatingBuilder |
withReturnReceiptTo(String fixedName,
javax.mail.internet.InternetAddress address)
Delegates to
withReturnReceiptTo(Recipient) with a new Recipient wrapped around the provided fixed name and address. |
EmailPopulatingBuilder |
withReturnReceiptTo(String name,
String address)
Delegates to
withReturnReceiptTo(Recipient) with a new Recipient wrapped around the provided name and address. |
EmailPopulatingBuilder |
withSubject(String subject)
Sets the optional subject of this email.
|
public Email buildEmail()
Email.Email(EmailPopulatingBuilder)
with this
as argument.public EmailPopulatingBuilder fixingMessageId(@Nullable String id)
Note that id can only ever be filled by end-users for sending an email. This library will never fill this field when converting a MimeMessage.
The id-format should be conform rfc5322#section-3.6.4
public EmailPopulatingBuilder from(@Nonnull String fromAddress)
from(String, String)
with empty name.public EmailPopulatingBuilder from(@Nullable String name, @Nonnull String fromAddress)
from(Recipient)
with a new Recipient
wrapped around the given name and email address.public EmailPopulatingBuilder from(@Nullable String fixedName, @Nonnull javax.mail.internet.InternetAddress fromAddress)
from(Recipient)
with a new Recipient
wrapped around the given fixed name and email address.public EmailPopulatingBuilder from(@Nonnull javax.mail.internet.InternetAddress fromAddress)
from(Recipient)
with a new Recipient
wrapped around the given email address.public EmailPopulatingBuilder from(@Nonnull Recipient recipient)
Recipient
(ignoring its Message.RecipientType
if provided).
Can be used in conjunction with one of the replyTo(...)
methods, which is then prioritized by email clients when replying to this
email.
recipient
- Preconfigured recipient which includes optional name and mandatory email address.from(String, String)
,
from(String)
,
withReplyTo(Recipient)
public EmailPopulatingBuilder withReplyTo(@Nullable String replyToAddress)
withReplyTo(Recipient)
with a new Recipient
wrapped around the given email address (or null if missing).public EmailPopulatingBuilder withReplyTo(@Nullable String fixedName, @Nonnull String replyToAddress)
withReplyTo(Recipient)
with a new Recipient
wrapped around the given fixed name and email address.public EmailPopulatingBuilder withReplyTo(@Nonnull javax.mail.internet.InternetAddress replyToAddress)
withReplyTo(Recipient)
with a new Recipient
wrapped around the given address.public EmailPopulatingBuilder withReplyTo(@Nullable String fixedName, @Nonnull javax.mail.internet.InternetAddress replyToAddress)
withReplyTo(Recipient)
with a new Recipient
wrapped around the given fixed name and address.public EmailPopulatingBuilder withReplyTo(@Nullable Recipient recipient)
Recipient
(ignoring its Message.RecipientType
if provided).
If provided, email clients should prioritize the replyTo recipient over the from recipient when replying to this email.
recipient
- Preconfigured recipient which includes optional name and mandatory email address.withReplyTo(String, String)
public EmailPopulatingBuilder withBounceTo(@Nullable String bounceToAddress)
withBounceTo(Recipient)
with a new Recipient
wrapped around the email address (or null if missing).public EmailPopulatingBuilder withBounceTo(@Nullable String name, @Nonnull String bounceToAddress)
withBounceTo(Recipient)
with a new Recipient
wrapped around the given name and email address.public EmailPopulatingBuilder withBounceTo(@Nonnull javax.mail.internet.InternetAddress bounceToAddress)
withBounceTo(Recipient)
with a new Recipient
wrapped around the given address.public EmailPopulatingBuilder withBounceTo(@Nullable String name, @Nonnull javax.mail.internet.InternetAddress bounceToAddress)
withBounceTo(Recipient)
with a new Recipient
wrapped around the given fixed name and address.public EmailPopulatingBuilder withBounceTo(@Nullable Recipient recipient)
Recipient
(ignoring its Message.RecipientType
if provided).
If provided, SMTP server should return bounced emails to this address. This is also known as the Return-Path
(or Envelope
FROM).
recipient
- Preconfigured recipient which includes optional name and mandatory email address.withBounceTo(String, String)
public EmailPopulatingBuilder withSubject(@Nullable String subject)
public EmailPopulatingBuilder withPlainText(@Nullable String text)
Both text and HTML can be provided, which will be offered to the email client as alternative content. Email clients that support it, will favor HTML over plain text and ignore the text body completely.
prependText(String)
,
appendText(String)
public EmailPopulatingBuilder prependText(@Nonnull String text)
withPlainText(String)
public EmailPopulatingBuilder appendText(@Nonnull String text)
withPlainText(String)
public EmailPopulatingBuilder withHTMLText(@Nullable String textHTML)
Both text and HTML can be provided, which will be offered to the email client as alternative content. Email clients that support it, will favor HTML over plain text and ignore the text body completely.
prependTextHTML(String)
,
appendTextHTML(String)
public EmailPopulatingBuilder prependTextHTML(@Nonnull String textHTML)
withHTMLText(String)
public EmailPopulatingBuilder appendTextHTML(@Nonnull String textHTML)
withHTMLText(String)
public EmailPopulatingBuilder to(@Nonnull Recipient... recipients)
#withRecipients(Collection, RecipientType)
with Message.RecipientType.TO
.public EmailPopulatingBuilder to(@Nonnull Collection<Recipient> recipients)
#withRecipients(Collection, RecipientType)
with Message.RecipientType.TO
.public EmailPopulatingBuilder to(@Nullable String name, String address)
toWithFixedName(String, String...)
.public EmailPopulatingBuilder to(@Nonnull String oneOrMoreAddresses)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.TO
and empty default name.public EmailPopulatingBuilder to(@Nullable String name, @Nonnull String... oneOrMoreAddressesEach)
toWithFixedName(String, String...)
.public EmailPopulatingBuilder to(@Nullable String name, @Nonnull Collection<String> oneOrMoreAddressesEach)
toWithFixedName(String, Collection)
.public EmailPopulatingBuilder toMultiple(@Nonnull String... oneOrMoreAddressesEach)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.TO
and empty default name.public EmailPopulatingBuilder toMultiple(@Nonnull Collection<String> oneOrMoreAddressesEach)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.TO
and empty default name.public EmailPopulatingBuilder toWithFixedName(@Nullable String name, @Nonnull String... oneOrMoreAddressesEach)
#withRecipientsWithFixedName(String, Collection, RecipientType)
with Message.RecipientType.TO
.public EmailPopulatingBuilder toWithDefaultName(@Nonnull String name, @Nonnull String... oneOrMoreAddressesEach)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.TO
.public EmailPopulatingBuilder toWithFixedName(@Nullable String name, @Nonnull Collection<String> oneOrMoreAddressesEach)
#withRecipientsWithFixedName(String, Collection, RecipientType)
with Message.RecipientType.TO
.public EmailPopulatingBuilder toWithDefaultName(@Nonnull String name, @Nonnull Collection<String> oneOrMoreAddressesEach)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.TO
.public EmailPopulatingBuilder to(@Nullable String name, javax.mail.internet.InternetAddress address)
public EmailPopulatingBuilder to(@Nonnull javax.mail.internet.InternetAddress address)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.TO
and empty default name.public EmailPopulatingBuilder to(@Nullable String name, @Nonnull javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
public EmailPopulatingBuilder toAddresses(@Nullable String name, @Nonnull Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
toAddressesWithFixedName(String, Collection)
.public EmailPopulatingBuilder toMultiple(@Nonnull javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.TO
and empty default name.public EmailPopulatingBuilder toMultipleAddresses(@Nonnull Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.TO
and empty default name.public EmailPopulatingBuilder toAddressesWithFixedName(@Nullable String name, @Nonnull javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
#withAddressesWithFixedName(String, Collection, RecipientType)
with Message.RecipientType.TO
.public EmailPopulatingBuilder toAddressesWithDefaultName(@Nonnull String name, @Nonnull javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.TO
.public EmailPopulatingBuilder toAddressesWithFixedName(@Nullable String name, @Nonnull Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
#withAddressesWithFixedName(String, Collection, RecipientType)
with Message.RecipientType.TO
.public EmailPopulatingBuilder toAddressesWithDefaultName(@Nonnull String name, @Nonnull Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.TO
.public EmailPopulatingBuilder cc(@Nonnull Recipient... recipients)
#withRecipients(Collection, RecipientType)
with Message.RecipientType.CC
.public EmailPopulatingBuilder cc(@Nonnull Collection<Recipient> recipients)
#withRecipients(Collection, RecipientType)
with Message.RecipientType.CC
.public EmailPopulatingBuilder cc(@Nullable String name, String address)
ccWithFixedName(String, String...)
.public EmailPopulatingBuilder cc(@Nonnull String oneOrMoreAddresses)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.CC
and empty default name.public EmailPopulatingBuilder cc(@Nullable String name, @Nonnull String... oneOrMoreAddressesEach)
ccWithFixedName(String, String...)
.public EmailPopulatingBuilder cc(@Nullable String name, @Nonnull Collection<String> oneOrMoreAddressesEach)
ccWithFixedName(String, Collection)
.public EmailPopulatingBuilder ccMultiple(@Nonnull String... oneOrMoreAddressesEach)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.CC
and empty default name.public EmailPopulatingBuilder ccAddresses(@Nonnull Collection<String> oneOrMoreAddressesEach)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.CC
and empty default name.public EmailPopulatingBuilder ccWithFixedName(@Nullable String name, @Nonnull String... oneOrMoreAddressesEach)
#withRecipientsWithFixedName(String, Collection, RecipientType)
with Message.RecipientType.CC
.public EmailPopulatingBuilder ccWithDefaultName(@Nonnull String name, @Nonnull String... oneOrMoreAddressesEach)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.CC
.public EmailPopulatingBuilder ccWithFixedName(@Nullable String name, @Nonnull Collection<String> oneOrMoreAddressesEach)
#withRecipientsWithFixedName(String, Collection, RecipientType)
with Message.RecipientType.CC
.public EmailPopulatingBuilder ccWithDefaultName(@Nonnull String name, @Nonnull Collection<String> oneOrMoreAddressesEach)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.CC
.public EmailPopulatingBuilder cc(@Nullable String name, javax.mail.internet.InternetAddress address)
public EmailPopulatingBuilder cc(@Nonnull javax.mail.internet.InternetAddress address)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.CC
and empty default name.public EmailPopulatingBuilder cc(@Nullable String name, @Nonnull javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
public EmailPopulatingBuilder ccAddresses(@Nullable String name, @Nonnull Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
ccAddressesWithFixedName(String, Collection)
.public EmailPopulatingBuilder ccMultiple(@Nonnull javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.CC
and empty default name.public EmailPopulatingBuilder ccMultipleAddresses(@Nonnull Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.CC
and empty default name.public EmailPopulatingBuilder ccAddressesWithFixedName(@Nullable String name, @Nonnull javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
#withAddressesWithFixedName(String, Collection, RecipientType)
with Message.RecipientType.CC
.public EmailPopulatingBuilder ccAddressesWithDefaultName(@Nonnull String name, @Nonnull javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.CC
.public EmailPopulatingBuilder ccAddressesWithFixedName(@Nullable String name, @Nonnull Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
#withAddressesWithFixedName(String, Collection, RecipientType)
with Message.RecipientType.CC
.public EmailPopulatingBuilder ccAddressesWithDefaultName(@Nonnull String name, @Nonnull Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.CC
.public EmailPopulatingBuilder bcc(@Nonnull Recipient... recipients)
#withRecipients(Collection, RecipientType)
with Message.RecipientType.BCC
.public EmailPopulatingBuilder bcc(@Nonnull Collection<Recipient> recipients)
#withRecipients(Collection, RecipientType)
with Message.RecipientType.BCC
.public EmailPopulatingBuilder bcc(@Nullable String name, String address)
bccWithFixedName(String, String...)
.public EmailPopulatingBuilder bcc(@Nonnull String oneOrMoreAddresses)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.BCC
and empty default name.public EmailPopulatingBuilder bcc(@Nullable String name, @Nonnull String... oneOrMoreAddressesEach)
bccWithFixedName(String, String...)
.public EmailPopulatingBuilder bcc(@Nullable String name, @Nonnull Collection<String> oneOrMoreAddressesEach)
bccWithFixedName(String, Collection)
.public EmailPopulatingBuilder bccMultiple(@Nonnull String... oneOrMoreAddressesEach)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.BCC
and empty default name.public EmailPopulatingBuilder bccAddresses(@Nonnull Collection<String> oneOrMoreAddressesEach)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.BCC
and empty default name.public EmailPopulatingBuilder bccWithFixedName(@Nullable String name, @Nonnull String... oneOrMoreAddressesEach)
#withRecipientsWithFixedName(String, Collection, RecipientType)
with Message.RecipientType.BCC
.public EmailPopulatingBuilder bccWithDefaultName(@Nonnull String name, @Nonnull String... oneOrMoreAddressesEach)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.BCC
.public EmailPopulatingBuilder bccWithFixedName(@Nullable String name, @Nonnull Collection<String> oneOrMoreAddressesEach)
#withRecipientsWithFixedName(String, Collection, RecipientType)
with Message.RecipientType.BCC
.public EmailPopulatingBuilder bccWithDefaultName(@Nonnull String name, @Nonnull Collection<String> oneOrMoreAddressesEach)
#withRecipientsWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.BCC
.public EmailPopulatingBuilder bcc(@Nullable String name, javax.mail.internet.InternetAddress address)
public EmailPopulatingBuilder bcc(@Nonnull javax.mail.internet.InternetAddress address)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.BCC
and empty default name.public EmailPopulatingBuilder bcc(@Nullable String name, @Nonnull javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
public EmailPopulatingBuilder bccAddresses(@Nullable String name, @Nonnull Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
public EmailPopulatingBuilder bccMultiple(@Nonnull javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.BCC
and empty default name.public EmailPopulatingBuilder bccMultipleAddresses(@Nonnull Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.BCC
and empty default name.public EmailPopulatingBuilder bccAddressesWithFixedName(@Nullable String name, @Nonnull javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
#withAddressesWithFixedName(String, Collection, RecipientType)
with Message.RecipientType.BCC
.public EmailPopulatingBuilder bccAddressesWithDefaultName(@Nonnull String name, @Nonnull javax.mail.internet.InternetAddress... oneOrMoreAddressesEach)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.BCC
.public EmailPopulatingBuilder bccAddressesWithFixedName(@Nullable String name, @Nonnull Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
#withAddressesWithFixedName(String, Collection, RecipientType)
with Message.RecipientType.BCC
.public EmailPopulatingBuilder bccAddressesWithDefaultName(@Nonnull String name, @Nonnull Collection<javax.mail.internet.InternetAddress> oneOrMoreAddressesEach)
#withAddressesWithDefaultName(String, Collection, RecipientType)
with Message.RecipientType.BCC
.@Nonnull public EmailPopulatingBuilder withRecipientsWithDefaultName(@Nullable String defaultName, @Nonnull Collection<String> oneOrMoreAddressesEach, @Nullable javax.mail.Message.RecipientType recipientType)
#withRecipients(String, boolean, Collection, RecipientType)
, leaving existing names in tact and defaulting when missing.@Nonnull public EmailPopulatingBuilder withRecipientsWithFixedName(@Nullable String fixedName, @Nonnull Collection<String> oneOrMoreAddressesEach, @Nullable javax.mail.Message.RecipientType recipientType)
#withRecipients(String, boolean, Collection, RecipientType)
, assigning or overwriting existing names with the provided.
name.@Nonnull public EmailPopulatingBuilder withRecipientsWithDefaultName(@Nullable String name, @Nullable javax.mail.Message.RecipientType recipientType, @Nonnull String... oneOrMoreAddressesEach)
#withRecipients(String, boolean, Collection, RecipientType)
.@Nonnull public EmailPopulatingBuilder withRecipientsWithFixedName(@Nullable String name, @Nullable javax.mail.Message.RecipientType recipientType, @Nonnull String... oneOrMoreAddressesEach)
#withRecipients(String, boolean, Collection, RecipientType)
.@Nonnull public EmailPopulatingBuilder withRecipients(@Nullable String name, boolean fixedName, @Nullable javax.mail.Message.RecipientType recipientType, @Nonnull String... oneOrMoreAddressesEach)
#withRecipients(String, boolean, Collection, RecipientType)
.@Nonnull public EmailPopulatingBuilder withRecipients(@Nullable String name, boolean fixedName, @Nonnull Collection<String> oneOrMoreAddressesEach, @Nullable javax.mail.Message.RecipientType recipientType)
withRecipient(Recipient)
for each address found in not just the collection, but also in every individual address string.fixedName
- Indicates whether the provided name should be applied to all addresses, or only to those where a name is
missing.oneOrMoreAddressesEach
- Collection of addresses. Each entry itself can be a delimited list of RFC2822 addresses.@Nonnull public EmailPopulatingBuilder withAddressesWithDefaultName(@Nullable String defaultName, @Nonnull Collection<javax.mail.internet.InternetAddress> addresses, @Nullable javax.mail.Message.RecipientType recipientType)
#withAddresses(String, boolean, Collection, RecipientType)
, leaving existing names in tact and defaulting when missing.@Nonnull public EmailPopulatingBuilder withAddressesWithFixedName(@Nullable String fixedName, @Nonnull Collection<javax.mail.internet.InternetAddress> addresses, @Nullable javax.mail.Message.RecipientType recipientType)
#withAddresses(String, boolean, Collection, RecipientType)
, assigning or overwriting existing names with the provided.@Nonnull public EmailPopulatingBuilder withAddresses(@Nullable String name, boolean fixedName, @Nonnull Collection<javax.mail.internet.InternetAddress> addresses, @Nullable javax.mail.Message.RecipientType recipientType)
#withRecipient(String, String, RecipientType)
for each address in the provided collection.fixedName
- Indicates whether the provided name should be applied to all addresses, or only to those where a name is missing.public EmailPopulatingBuilder withRecipients(@Nonnull Collection<Recipient> recipients)
#withRecipients(Collection, RecipientType)
with Message.RecipientType
left empty (so it will use the original values).public EmailPopulatingBuilder withRecipients(@Nonnull Recipient... recipients)
#withRecipients(Collection, RecipientType)
with Message.RecipientType
left empty (so it will use the original values).@Nonnull public EmailPopulatingBuilder withRecipients(@Nonnull Collection<Recipient> recipients, @Nullable javax.mail.Message.RecipientType fixedRecipientType)
#withRecipient(String, String, RecipientType)
for each recipient in the provided collection, optionally fixing the
recipientType for all recipients to the provided type.fixedRecipientType
- Optional. Fixes all recipients to the given type. If omitted, the types are not removed, but kept as-is.public EmailPopulatingBuilder withRecipient(@Nonnull String singleAddress, @Nullable javax.mail.Message.RecipientType recipientType)
#withRecipient(String, String, RecipientType)
with the name omitted.public EmailPopulatingBuilder withRecipient(@Nullable String name, @Nonnull String singleAddress, @Nullable javax.mail.Message.RecipientType recipientType)
Recipient
instance with the given name, address and Message.RecipientType
.
Note that the email address must be a single address according to RFC2822 format. Name can be provided explicitly or as part of the RFC2822 email address or omitted completely. If provided as method argument, the name overrides any nested name.
name
- Optional explicit name. Can be included in the email address instead, or omitted completely. A name will show as "Name Here <[email protected]>"
singleAddress
- A single address according to RFC2822 format with or without personal name.recipientType
- Optional type of recipient. This is needed for TO, CC and BCC, but not for bounceTo, returnReceiptTo,
replyTo, from etc.public EmailPopulatingBuilder withRecipient(@Nonnull Recipient recipient)
Recipient
instance as copy of the provided recipient (copying name, address and Message.RecipientType
).
Note that the email address must be a single address according to RFC2822 format. Name can be provided explicitly or as part of the RFC2822 email address or omitted completely.
public EmailPopulatingBuilder withEmbeddedImage(@Nonnull String name, @Nonnull byte[] data, @Nonnull String mimetype)
withEmbeddedImage(String, DataSource)
, with a named ByteArrayDataSource
created using the provided name, data and
mimetype.name
- The name of the image as being referred to from the message content body (eg. 'signature').data
- The byte data of the image to be embedded.mimetype
- The content type of the given data (eg. "image/gif" or "image/jpeg").public EmailPopulatingBuilder withEmbeddedImage(@Nullable String name, @Nonnull DataSource imagedata)
withAttachment(String, DataSource)
instead.
The provided DataSource
is assumed to be of mimetype png, jpg or whatever the email client supports as valid image embedded in HTML
content.
name
- The name of the image as being referred to from the message content body (eg. 'src="cid:yourImageName"'). If not provided, the
name of the given data source is used instead.imagedata
- The image data.withEmbeddedImage(String, byte[], String)
,
withEmbeddedImages(List)
public EmailPopulatingBuilder withEmbeddedImages(@Nonnull List<AttachmentResource> embeddedImages)
withEmbeddedImage(String, DataSource)
for each embedded image.public <T> EmailPopulatingBuilder withHeaders(@Nonnull Map<String,T> headers)
withHeader(String, Object)
for each header in the provided Map
.public EmailPopulatingBuilder withHeader(@Nonnull String name, @Nullable Object value)
headers
list. The value is stored as a String
. example: email.addHeader("X-Priority",
2)
name
- The name of the header.value
- The value of the header, which will be stored using String.valueOf(Object)
.withHeaders(Map)
public EmailPopulatingBuilder withAttachment(@Nullable String name, @Nonnull byte[] data, @Nonnull String mimetype)
withAttachment(String, DataSource)
, with a named ByteArrayDataSource
created using the provided name, data and
mimetype.name
- Optional name of the attachment (eg. 'filename.ext'). If omitted, the internal name of the datasource is used. If that too is
empty, a name will be generated using UUID
.data
- The binary data of the attachment.mimetype
- The content type of the given data (eg. "plain/text", "image/gif" or "application/pdf").withAttachment(String, DataSource)
,
withAttachments(List)
public EmailPopulatingBuilder withAttachment(@Nullable String name, @Nonnull DataSource filedata)
Note: for embedding images instead of attaching them for download, refer to withEmbeddedImage(String, DataSource)
instead.
name
- Optional name of the attachment (eg. 'filename.ext'). If omitted, the internal name of the datasource is used. If that too is
empty, a name will be generated using UUID
.filedata
- The attachment data.withAttachment(String, byte[], String)
,
withAttachments(List)
public EmailPopulatingBuilder withAttachments(@Nonnull List<AttachmentResource> attachments)
withAttachment(String, DataSource)
for each attachment.public EmailPopulatingBuilder signWithDomainKey(@Nonnull byte[] dkimPrivateKey, @Nonnull String signingDomain, @Nonnull String dkimSelector)
signWithDomainKey(InputStream, String, String)
with a ByteArrayInputStream
wrapped around the prodived dkimPrivateKey
data.public EmailPopulatingBuilder signWithDomainKey(@Nonnull String dkimPrivateKey, @Nonnull String signingDomain, @Nonnull String dkimSelector)
signWithDomainKey(InputStream, String, String)
with a ByteArrayInputStream
wrapped around the prodived dkimPrivateKey
string converted to UTF_8 byte array.public EmailPopulatingBuilder signWithDomainKey(@Nonnull InputStream dkimPrivateKeyInputStream, @Nonnull String signingDomain, @Nonnull String dkimSelector)
Mailer
.
Also see:
dkimPrivateKeyInputStream
- De key content used to sign for the sending party.signingDomain
- The domain being authorized to send.dkimSelector
- Additional domain specifier.signWithDomainKey(byte[], String, String)
,
signWithDomainKey(String, String, String)
,
signWithDomainKey(File, String, String)
public EmailPopulatingBuilder signWithDomainKey(@Nonnull File dkimPrivateKeyFile, @Nonnull String signingDomain, @Nonnull String dkimSelector)
signWithDomainKey(InputStream, String, String)
, but with a File reference that is later read as InputStream
.public EmailPopulatingBuilder withDispositionNotificationTo()
dispositionNotificationTo
. The actual address will default to the replyToRecipient
first if set or else fromRecipient
(the final address is determined when sending this email).withDispositionNotificationTo(Recipient)
public EmailPopulatingBuilder withDispositionNotificationTo(@Nonnull String address)
withDispositionNotificationTo(Recipient)
with a new Recipient
wrapped around the provided address.public EmailPopulatingBuilder withDispositionNotificationTo(@Nullable String name, @Nonnull String address)
withDispositionNotificationTo(Recipient)
with a new Recipient
wrapped around the provided name and address.public EmailPopulatingBuilder withDispositionNotificationTo(@Nonnull javax.mail.internet.InternetAddress address)
withDispositionNotificationTo(Recipient)
with a new Recipient
wrapped around the provided address.public EmailPopulatingBuilder withDispositionNotificationTo(@Nullable String fixedName, @Nonnull javax.mail.internet.InternetAddress address)
withDispositionNotificationTo(Recipient)
with a new Recipient
wrapped around the provided fixed name and address.public EmailPopulatingBuilder withDispositionNotificationTo(@Nonnull Recipient recipient)
Recipient
. This flag can be used to request a return receipt from the recipient to signal that the recipient has read the
email.
This flag may be ignored by SMTP clients (for example gmail ignores it completely, while the Google Apps business suite honors it).
public EmailPopulatingBuilder withReturnReceiptTo()
returnReceiptTo
. The actual address will default to the replyToRecipient
first if set
or else fromRecipient
(the final address is determined when sending the email).
For more detailed information, refer to withReturnReceiptTo(Recipient)
.
public EmailPopulatingBuilder withReturnReceiptTo(@Nonnull String address)
withReturnReceiptTo(Recipient)
with a new Recipient
wrapped around the provided address.public EmailPopulatingBuilder withReturnReceiptTo(@Nullable String name, @Nonnull String address)
withReturnReceiptTo(Recipient)
with a new Recipient
wrapped around the provided name and address.public EmailPopulatingBuilder withReturnReceiptTo(@Nonnull javax.mail.internet.InternetAddress address)
withReturnReceiptTo(Recipient)
with a new Recipient
wrapped around the provided address.public EmailPopulatingBuilder withReturnReceiptTo(@Nullable String fixedName, @Nonnull javax.mail.internet.InternetAddress address)
withReturnReceiptTo(Recipient)
with a new Recipient
wrapped around the provided fixed name and address.public EmailPopulatingBuilder withReturnReceiptTo(@Nonnull Recipient recipient)
Recipient
. This flag can be used to request a notification from the SMTP server recipient to signal that the recipient
has read the email.
This flag is rarely used, but your mail server / client might implement this flag to automatically send back a notification that the email was received on the mail server or opened in the client, depending on the chosen implementation.
public EmailPopulatingBuilder clearId()
id
to empty.public EmailPopulatingBuilder clearFromRecipient()
fromRecipient
to empty.public EmailPopulatingBuilder clearReplyTo()
replyToRecipient
to empty.public EmailPopulatingBuilder clearBounceTo()
bounceToRecipient
to empty.public EmailPopulatingBuilder clearPlainText()
text
to empty.public EmailPopulatingBuilder clearHTMLText()
textHTML
to empty.public EmailPopulatingBuilder clearSubject()
subject
to empty.public EmailPopulatingBuilder clearRecipients()
recipients
to empty.public EmailPopulatingBuilder clearEmbeddedImages()
embeddedImages
to empty.public EmailPopulatingBuilder clearAttachments()
attachments
to empty.public EmailPopulatingBuilder clearHeaders()
headers
to empty.public EmailPopulatingBuilder clearDkim()
public EmailPopulatingBuilder clearDispositionNotificationTo()
dispositionNotificationTo
to empty.public EmailPopulatingBuilder clearReturnReceiptTo()
returnReceiptTo
to empty.public String getId()
fixingMessageId(String)
public Recipient getFromRecipient()
from(Recipient)
public Recipient getReplyToRecipient()
withReplyTo(Recipient)
public Recipient getBounceToRecipient()
withBounceTo(Recipient)
public String getText()
withPlainText(String)
public String getTextHTML()
withHTMLText(String)
public String getSubject()
withSubject(String)
public List<Recipient> getRecipients()
to(Recipient...)
,
cc(Recipient...)
,
bcc(Recipient...)
public List<AttachmentResource> getEmbeddedImages()
withEmbeddedImage(String, DataSource)
public List<AttachmentResource> getAttachments()
withAttachment(String, DataSource)
public File getDkimPrivateKeyFile()
signWithDomainKey(File, String, String)
public InputStream getDkimPrivateKeyInputStream()
public String getDkimSigningDomain()
public String getDkimSelector()
public boolean isUseDispositionNotificationTo()
public Recipient getDispositionNotificationTo()
public boolean isUseReturnReceiptTo()
public Recipient getReturnReceiptTo()
public javax.mail.internet.MimeMessage getEmailToForward()
EmailBuilder.forwarding(MimeMessage)
Copyright © 2018. All rights reserved.