Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
void |
addAttachment(String name,
byte[] data,
String mimetype)
Adds an attachment to the email message and generates the necessary
DataSource with the given byte data. |
void |
addAttachment(String name,
DataSource filedata)
Overloaded method which sets an attachment on account of name and
DataSource . |
Email.Builder |
addHeader(String name,
Object value)
Adds a header to the
headers list. |
Email.Builder |
bcc(Recipient recipient)
Adds a new
Recipient to the list on account of name, address with recipient type Message.RecipientType.BCC . |
Email.Builder |
bcc(String name,
String address)
Adds a new
Recipient to the list on account of name, address with recipient type Message.RecipientType.BCC . |
Email |
build() |
Email.Builder |
cc(Recipient recipient)
Adds a new
Recipient to the list on account of name, address with recipient type Message.RecipientType.CC . |
Email.Builder |
cc(String name,
String address)
Adds a new
Recipient to the list on account of name, address with recipient type Message.RecipientType.CC . |
Email.Builder |
embedImage(String name,
byte[] data,
String mimetype)
Adds an embedded image (attachment type) to the email message and generates the necessary
DataSource with the given byte
data. |
Email.Builder |
embedImage(String name,
DataSource imagedata)
Overloaded method which sets an embedded image on account of name and
DataSource . |
Email.Builder |
from(String name,
String fromAddress)
Sets the sender address.
|
Email.Builder |
replyTo(String name,
String replyToAddress)
Sets the reply-to address (optional).
|
Email.Builder |
subject(String subject)
Sets the
subject . |
Email.Builder |
text(String text)
Sets the
text . |
Email.Builder |
textHTML(String textHTML)
Sets the
textHTML . |
Email.Builder |
to(Recipient recipient)
Adds a new
Recipient to the list on account of name, address with recipient type Message.RecipientType.TO . |
Email.Builder |
to(String name,
String address)
Adds a new
Recipient to the list on account of name, address with recipient type Message.RecipientType.TO . |
public Email build()
public Email.Builder from(String name, String fromAddress)
name
- The sender's name.fromAddress
- The sender's email address.public Email.Builder replyTo(String name, String replyToAddress)
name
- The replied-to-receiver name.replyToAddress
- The replied-to-receiver email address.public Email.Builder subject(String subject)
subject
.public Email.Builder text(String text)
text
.public Email.Builder textHTML(String textHTML)
textHTML
.public Email.Builder to(String name, String address)
Recipient
to the list on account of name, address with recipient type Message.RecipientType.TO
.name
- The name of the recipient.address
- The emailaddress of the recipient.recipients
,
Recipient
public Email.Builder to(Recipient recipient)
Recipient
to the list on account of name, address with recipient type Message.RecipientType.TO
.recipient
- The recipent whose name and address to userecipients
,
Recipient
public Email.Builder cc(String name, String address)
Recipient
to the list on account of name, address with recipient type Message.RecipientType.CC
.name
- The name of the recipient.address
- The emailaddress of the recipient.recipients
,
Recipient
public Email.Builder cc(Recipient recipient)
Recipient
to the list on account of name, address with recipient type Message.RecipientType.CC
.recipient
- The recipent whose name and address to userecipients
,
Recipient
public Email.Builder bcc(String name, String address)
Recipient
to the list on account of name, address with recipient type Message.RecipientType.BCC
.name
- The name of the recipient.address
- The emailaddress of the recipient.recipients
,
Recipient
public Email.Builder bcc(Recipient recipient)
Recipient
to the list on account of name, address with recipient type Message.RecipientType.BCC
.recipient
- The recipent whose name and address to userecipients
,
Recipient
public Email.Builder embedImage(String name, byte[] data, String mimetype)
DataSource
with the given byte
data. Then delegates to Email.addEmbeddedImage(String, DataSource)
. At this point the datasource is actually a
ByteArrayDataSource
.name
- The name of the image as being referred to from the message content body (eg. '<cid: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").ByteArrayDataSource
,
Email.addEmbeddedImage(String, DataSource)
public Email.Builder embedImage(String name, DataSource imagedata)
DataSource
.name
- The name of the image as being referred to from the message content body (eg. '<cid:embeddedimage>').imagedata
- The image data.public Email.Builder addHeader(String name, 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)
.public void addAttachment(String name, byte[] data, String mimetype)
DataSource
with the given byte data. Then delegates to
addAttachment(String, DataSource)
. At this point the datasource is actually a ByteArrayDataSource
.name
- The name of the extension (eg. filename including extension).data
- The byte data of the attachment.mimetype
- The content type of the given data (eg. "plain/text", "image/gif" or "application/pdf").ByteArrayDataSource
,
addAttachment(String, DataSource)
public void addAttachment(String name, DataSource filedata)
DataSource
.name
- The name of the attachment (eg. 'filename.ext').filedata
- The attachment data.Copyright © 2016. All rights reserved.