public class MailMessage extends Object
Constructor and Description |
---|
MailMessage()
construct empty mail message that can be used with the setters
|
MailMessage(JsonObject json)
construct object from a JsonObject representation
|
MailMessage(MailMessage other)
copy object to another @link MailMessage object
|
MailMessage(String from,
String to,
String subject,
String text)
construct a simple message with text/plain
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
List<MailAttachment> |
getAttachment()
get the list of attachments of this mail
|
List<String> |
getBcc()
get list of bcc addresses
|
String |
getBounceAddress()
get bounce address of this mail
|
List<String> |
getCc()
get list of cc addresses
|
String |
getFrom()
get from address of this mail
|
MultiMap |
getHeaders()
get the headers to be set before filling our headers
|
String |
getHtml()
get the html text of this mail
|
String |
getSubject()
get the subject of this mail
|
String |
getText()
get the plain text of this mail
|
List<String> |
getTo()
get list of to addresses
|
int |
hashCode() |
boolean |
isFixedHeaders()
get whether our own headers should be the only headers added to the message
|
MailMessage |
setAttachment(List<MailAttachment> attachment)
set the list of attachments of this mail
|
MailMessage |
setAttachment(MailAttachment attachment)
set a single attachment of this mail the result of getAttachment when using
this method returns an unmodifiable list, if you want to be able to add
attachments later, please use
setAttachment(new ArrayList<MailAttachment>()) instead |
MailMessage |
setBcc(List<String> bcc)
set list of bcc addresses
|
MailMessage |
setBcc(String bcc)
helper method for single recipient
|
MailMessage |
setBounceAddress(String bounceAddress)
set bounce address of this mail
|
MailMessage |
setCc(List<String> cc)
set list of cc addresses
|
MailMessage |
setCc(String cc)
helper method for single recipient
|
MailMessage |
setFixedHeaders(boolean fixedHeaders)
set whether our own headers should be the only headers added to the message
|
MailMessage |
setFrom(String from)
set from address of this mail
|
MailMessage |
setHeaders(MultiMap headers)
set the headers to be set before filling our headers
|
MailMessage |
setHtml(String html)
set the html text of this mail
|
MailMessage |
setSubject(String subject)
set the subject of this mail
|
MailMessage |
setText(String text)
set the plain text of this mail
|
MailMessage |
setTo(List<String> to)
set list of to addresses
|
MailMessage |
setTo(String to)
helper method for single recipient
|
JsonObject |
toJson()
convert the mail message to Json representation
|
public MailMessage()
public MailMessage(MailMessage other)
other
- object to copypublic MailMessage(JsonObject json)
json
- json object to copypublic String getBounceAddress()
public MailMessage setBounceAddress(String bounceAddress)
bounceAddress
- bounce addresspublic String getFrom()
public MailMessage setFrom(String from)
from
- from addrsspublic MailMessage setTo(List<String> to)
to
- List of to addressespublic MailMessage setTo(String to)
to
- to addresspublic MailMessage setCc(List<String> cc)
cc
- List of cc addressespublic MailMessage setCc(String cc)
cc
- cc addresspublic MailMessage setBcc(List<String> bcc)
bcc
- List of bcc addressespublic MailMessage setBcc(String bcc)
bcc
- bcc addresspublic String getSubject()
public MailMessage setSubject(String subject)
subject
- the subjectpublic String getText()
public MailMessage setText(String text)
text
- the textpublic String getHtml()
public MailMessage setHtml(String html)
html
- the textpublic List<MailAttachment> getAttachment()
public MailMessage setAttachment(List<MailAttachment> attachment)
attachment
- List of attachmentpublic MailMessage setAttachment(MailAttachment attachment)
setAttachment(new ArrayList<MailAttachment>())
insteadattachment
- the attachment to addpublic MultiMap getHeaders()
public MailMessage setHeaders(MultiMap headers)
headers
- the headers to setpublic boolean isFixedHeaders()
public MailMessage setFixedHeaders(boolean fixedHeaders)
fixedHeaders
- the fixedHeaders to setpublic JsonObject toJson()
Copyright © 2015. All Rights Reserved.