Package psiprobe.tools
Class MailMessage
- java.lang.Object
-
- psiprobe.tools.MailMessage
-
public class MailMessage extends Object
The Class MailMessage.
-
-
Field Summary
Fields Modifier and Type Field Description private List<DataSource>
attachments
The attachments.private List<String>
bcc
The bcc.private String
body
The body.private boolean
bodyHtml
The body html.private List<String>
cc
The cc.private String
subject
The subject.private List<String>
to
The to.
-
Constructor Summary
Constructors Constructor Description MailMessage(String to, String subject, String body)
Instantiates a new mail message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MailMessage
addAttachment(File attachment)
Adds the attachment.MailMessage
addAttachment(DataSource attachment)
Adds the attachment.MailMessage
addRecipientBcc(String address)
Adds the recipient bcc.MailMessage
addRecipientCc(String address)
Adds the recipient cc.MailMessage
addRecipientTo(String address)
Adds the recipient to.MailMessage
clearAttachments()
Clear attachments.MailMessage
clearRecipientsBcc()
Clear recipients bcc.MailMessage
clearRecipientsCc()
Clear recipients cc.MailMessage
clearRecipientsTo()
Clear recipients to.protected List<DataSource>
getAttachments()
Gets the attachments.DataSource[]
getAttachmentsArray()
Gets the attachments array.protected List<String>
getBcc()
Gets the bcc.String[]
getBccArray()
Gets the bcc array.String
getBody()
Gets the body.protected List<String>
getCc()
Gets the cc.String[]
getCcArray()
Gets the cc array.String
getSubject()
Gets the subject.protected List<String>
getTo()
Gets the to.String[]
getToArray()
Gets the to array.boolean
isBodyHtml()
Checks if is body html.MailMessage
setBody(String body)
Sets the body.MailMessage
setBodyHtml(boolean bodyHtml)
Sets the body html.MailMessage
setSubject(String subject)
Sets the subject.
-
-
-
Field Detail
-
attachments
private final List<DataSource> attachments
The attachments.
-
subject
private String subject
The subject.
-
body
private String body
The body.
-
bodyHtml
private boolean bodyHtml
The body html.
-
-
Method Detail
-
getToArray
public String[] getToArray()
Gets the to array.- Returns:
- the to array
-
getCcArray
public String[] getCcArray()
Gets the cc array.- Returns:
- the cc array
-
getBccArray
public String[] getBccArray()
Gets the bcc array.- Returns:
- the bcc array
-
getAttachmentsArray
public DataSource[] getAttachmentsArray()
Gets the attachments array.- Returns:
- the attachments array
-
getSubject
public String getSubject()
Gets the subject.- Returns:
- the subject
-
getBody
public String getBody()
Gets the body.- Returns:
- the body
-
isBodyHtml
public boolean isBodyHtml()
Checks if is body html.- Returns:
- true, if is body html
-
addRecipientTo
public MailMessage addRecipientTo(String address)
Adds the recipient to.- Parameters:
address
- the address- Returns:
- the mail message
-
addRecipientCc
public MailMessage addRecipientCc(String address)
Adds the recipient cc.- Parameters:
address
- the address- Returns:
- the mail message
-
addRecipientBcc
public MailMessage addRecipientBcc(String address)
Adds the recipient bcc.- Parameters:
address
- the address- Returns:
- the mail message
-
addAttachment
public MailMessage addAttachment(File attachment)
Adds the attachment.- Parameters:
attachment
- the attachment- Returns:
- the mail message
-
addAttachment
public MailMessage addAttachment(DataSource attachment)
Adds the attachment.- Parameters:
attachment
- the attachment- Returns:
- the mail message
-
clearRecipientsTo
public MailMessage clearRecipientsTo()
Clear recipients to.- Returns:
- the mail message
-
clearRecipientsCc
public MailMessage clearRecipientsCc()
Clear recipients cc.- Returns:
- the mail message
-
clearRecipientsBcc
public MailMessage clearRecipientsBcc()
Clear recipients bcc.- Returns:
- the mail message
-
clearAttachments
public MailMessage clearAttachments()
Clear attachments.- Returns:
- the mail message
-
setSubject
public MailMessage setSubject(String subject)
Sets the subject.- Parameters:
subject
- the subject- Returns:
- the mail message
-
setBody
public MailMessage setBody(String body)
Sets the body.- Parameters:
body
- the body- Returns:
- the mail message
-
setBodyHtml
public MailMessage setBodyHtml(boolean bodyHtml)
Sets the body html.- Parameters:
bodyHtml
- the body html- Returns:
- the mail message
-
getAttachments
protected List<DataSource> getAttachments()
Gets the attachments.- Returns:
- the attachments
-
-