|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sape.carbon.services.email.MailDataObject
This class encapsulates all the information required to send an email.
Copyright 2002 Sapient
Field Summary | |
private MailAttachment[] |
attachments
A array containing the attachments to be send alongwith the mail. |
private HashMap |
bccMap
A Map containing the mapping of email to names for all 'BCC' recipients of the mail. |
private String |
body
The body of the mail. |
private MailContentTypeEnum |
bodyType
The bodyType of the mail. |
private HashMap |
ccMap
A Map containing the mapping of email to names for all 'CC' recipients of the mail. |
private String |
charset
The charset used to encode the contents of the mail. |
private String |
fromEmail
The email address for the sender of the mail. |
private String |
fromPersonal
The name of the sender of the mail. |
private HashMap |
headers
A Map containing the mapping of header name to header value for any additional headers for the mail. |
private String |
subject
The subject of the mail. |
private HashMap |
toMap
A Map containing the mapping of emails to names for all 'TO' recipients of the mail. |
Constructor Summary | |
MailDataObject()
Initializes all the HashMap's |
Method Summary | |
void |
addBCC(Map bccMap)
Adds a map of recipients email id to name in 'BCC' recipients of the mail. |
void |
addBCC(String bccEmail,
String bccPersonal)
Adds a recipient email id and name in 'BCC' recipients of the mail. |
void |
addCC(Map ccMap)
Adds a map of recipients email id to name in 'CC' recipients of the mail. |
void |
addCC(String ccEmail,
String ccPersonal)
Adds a recipient email id and name in 'CC' recipients of the mail. |
void |
addHeader(Map headers)
Adds any addtional headers. |
void |
addHeader(String headerName,
String headerValue)
Adds any addtional headers. |
void |
addTo(Map toMap)
Adds a map of recipients email id to name in 'TO' recipients of the mail. |
void |
addTo(String toEmail,
String toPersonal)
Adds a recipient email id and name in 'TO' recipients of the mail. |
MailAttachment[] |
getAttachments()
Getter for attachments. |
Map |
getBCCMap()
Getter for 'BCC' recipients in the mail. |
String |
getBody()
Getter for body. |
MailContentTypeEnum |
getBodyType()
Getter for body type. |
Map |
getCCMap()
Getter for 'CC' recipients in the mail. |
String |
getCharset()
Getter for charset. |
String |
getFromEmail()
Getter for sender's email id. |
String |
getFromName()
Getter for sender's name. |
Map |
getHeaders()
Getter for additional headers in the mail. |
String |
getSubject()
Getter for subject. |
Map |
getToMap()
Getter for 'TO' recipients in the mail. |
void |
setAttachments(MailAttachment[] attachments)
Sets the Attachments to be send alongwith the mail. |
void |
setBody(String body,
MailContentTypeEnum bodyType)
Set's the mail body and body type. |
void |
setCharset(String charset)
Setter for charset. |
void |
setFrom(String fromEmail,
String fromPersonal)
Set's the sender's email id and name. |
void |
setSubject(String subject)
Setter for mail subject. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private HashMap toMap
A Map containing the mapping of emails to names for all 'TO' recipients of the mail.
private HashMap ccMap
A Map containing the mapping of email to names for all 'CC' recipients of the mail.
private HashMap bccMap
A Map containing the mapping of email to names for all 'BCC' recipients of the mail.
private HashMap headers
A Map containing the mapping of header name to header value for any additional headers for the mail.
private String fromEmail
The email address for the sender of the mail.
private String fromPersonal
The name of the sender of the mail.
private String subject
The subject of the mail.
private String body
The body of the mail.
private String charset
The charset used to encode the contents of the mail.
private MailContentTypeEnum bodyType
The bodyType
of the mail.
private MailAttachment[] attachments
A array containing the attachments to be send alongwith the mail.
Constructor Detail |
public MailDataObject()
Initializes all the HashMap's
Method Detail |
public void addTo(String toEmail, String toPersonal)
Adds a recipient email id and name in 'TO' recipients of the mail.
toEmail
- The email id of the recipient.toPersonal
- The name of the recipient.public void addTo(Map toMap)
Adds a map of recipients email id to name in 'TO' recipients of the mail.
toMap
- A Map containing the mapping of emails to names for all
'TO' recipients of the email.public void addCC(String ccEmail, String ccPersonal)
Adds a recipient email id and name in 'CC' recipients of the mail.
ccEmail
- The email id of the recipient.ccPersonal
- The name of the recipient.public void addCC(Map ccMap)
Adds a map of recipients email id to name in 'CC' recipients of the mail.
ccMap
- A Map containing the mapping of emails to names for all
'CC' recipients of the email.public void addBCC(String bccEmail, String bccPersonal)
Adds a recipient email id and name in 'BCC' recipients of the mail.
bccEmail
- The email id of the recipient.bccPersonal
- The name of the recipient.public void addBCC(Map bccMap)
Adds a map of recipients email id to name in 'BCC' recipients of the mail.
bccMap
- A Map containing the mapping of emails to names for all
'BCC' recipients of the email.public void setFrom(String fromEmail, String fromPersonal)
Set's the sender's email id and name.
fromEmail
- The sender's email id.fromPersonal
- The sender's name.public void setSubject(String subject)
Setter for mail subject.
subject
- the subject of the messagepublic void setBody(String body, MailContentTypeEnum bodyType)
Set's the mail body and body type.
body
- content of the messagebodyType
- type of message body (plain, html, etc)public void setCharset(String charset)
Setter for charset.
charset
- the charset of the mail messagepublic void addHeader(String headerName, String headerValue)
Adds any addtional headers.
headerName
- name of header to addheaderValue
- value of the headerpublic void addHeader(Map headers)
Adds any addtional headers.
headers
- additional headers to add to the messagepublic void setAttachments(MailAttachment[] attachments)
Sets the Attachments to be send alongwith the mail.
attachments
- A array containing the attachments to be
send along with the mail.public Map getToMap()
Getter for 'TO' recipients in the mail.
public Map getCCMap()
Getter for 'CC' recipients in the mail.
public Map getBCCMap()
Getter for 'BCC' recipients in the mail.
public Map getHeaders()
Getter for additional headers in the mail.
public String getFromName()
Getter for sender's name.
public String getFromEmail()
Getter for sender's email id.
public String getCharset()
Getter for charset.
public String getSubject()
Getter for subject.
public String getBody()
Getter for body.
public MailContentTypeEnum getBodyType()
Getter for body type.
public MailAttachment[] getAttachments()
Getter for attachments.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |