public class Message extends Object
fromEmail
).
Attachments are stored in the property
attachments
). An attachment may be
of the type MsgAttachment
which
represents another attached (encapsulated)
.msg object.Modifier and Type | Field and Description |
---|---|
protected List<Attachment> |
attachments
A list of all attachments (both
FileAttachment
and MsgAttachment ). |
protected String |
bodyRTF
The body in RTF format (if available)
|
protected String |
bodyText
The normalized body text.
|
protected Date |
date
Email Date
|
protected String |
displayBcc
The displayed Bcc: field
|
protected String |
displayCc
The displayed Cc: field
|
protected String |
displayTo
The displayed To: field
|
protected String |
fromEmail
The address part of From: mail address.
|
protected String |
fromName
The name part of the From: mail address
|
protected String |
headers
Email headers (if available)
|
protected static Logger |
logger |
protected String |
messageClass
The message class as defined in the .msg file.
|
protected String |
messageId
The message Id.
|
protected Map<String,Object> |
properties
Contains all properties that are not
covered by the special properties.
|
protected List<RecipientEntry> |
recipients
A list containing all recipients for this message
(which can be set in the 'to:', 'cc:' and 'bcc:' field, respectively).
|
protected String |
subject
The mail's subject.
|
protected String |
toEmail
The address part of To: mail address.
|
protected String |
toName
The name part of the To: mail address
|
Constructor and Description |
---|
Message() |
protected static final Logger logger
protected String messageClass
protected String messageId
protected String fromEmail
protected String fromName
protected String toEmail
protected String toName
protected String subject
protected String bodyText
protected String displayTo
protected String displayCc
protected String displayBcc
protected String bodyRTF
protected String headers
protected Date date
protected List<Attachment> attachments
FileAttachment
and MsgAttachment
).protected Map<String,Object> properties
protected List<RecipientEntry> recipients
public void addAttachment(Attachment attachment)
public void addRecipient(RecipientEntry recipient)
public void setProperty(String name, Object value) throws ClassCastException
properties
map. Some properties are put into
special attributes (e.g., toEmail
when
the property name is '0076').name
- The property name (i.e., the class
of the document entry).value
- The value of the field.ClassCastException
- Thrown if the detected data
type does not match the expected data type.public String toString()
toString
in class Object
Object.toString()
public String toLongString()
public String createMailString(String mail, String name)
mail
- The mail address.name
- The name part of the address.public List<Attachment> getAttachments()
public void setAttachments(List<Attachment> attachments)
attachments
- the attachments to setpublic List<RecipientEntry> getRecipients()
public void setRecipients(List<RecipientEntry> recipients)
recipients
- the recipients to setpublic String getBodyText()
public void setBodyText(String bodyText)
bodyText
- the bodyText to setpublic String getFromEmail()
public void setFromEmail(String fromEmail)
fromEmail
- the fromEmail to setpublic String getFromName()
public void setFromName(String fromName)
fromName
- the fromName to setpublic String getDisplayTo()
public void setDisplayTo(String displayTo)
public String getDisplayCc()
public void setDisplayCc(String displayCc)
public String getDisplayBcc()
public void setDisplayBcc(String displayBcc)
public String getMessageClass()
public void setMessageClass(String messageClass)
messageClass
- the messageClass to setpublic String getMessageId()
public void setMessageId(String messageId)
messageId
- the messageId to setpublic String getSubject()
public void setSubject(String subject)
subject
- the subject to setpublic String getToEmail()
public void setToEmail(String toEmail)
toEmail
- the toEmail to setpublic String getToName()
public void setToName(String toName)
toName
- the toName to setpublic String getBodyRTF()
public void setBodyRTF(String bodyRTF)
bodyRTF
- the bodyRTF to setpublic String getHeaders()
public void setHeaders(String headers)
headers
- the headers to setpublic static Date getDateFromHeaders(String headers)
headers
- The headers in a single String objectpublic Date getDate()
public void setDate(Date date)
date
- the date to setThis software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.