public class Message extends Part
| Modifier and Type | Class and Description |
|---|---|
static interface |
Message.RecipientType |
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
subject
The subject of this message
|
java.lang.String |
uidl |
protected Vector |
vFrom |
protected Vector[] |
vRecipients |
ATTACHMENT, BINARY, content, contentHandler, disposition, fileName, headers, HTML, INLINE, mimeType, PLAIN| Constructor and Description |
|---|
Message()
Creates a new empty message.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFrom(Address[] addresses)
Add these addresses to the existing "From" attribute.
|
void |
addHeader(java.lang.String name,
java.lang.String value)
Add this value to the existing values for this header name.
|
void |
addRecipient(int type,
Address address)
Add this recipient address to the existing ones of the given type.
|
void |
addRecipients(int type,
Address[] addresses)
Add these recipient addresses to the existing ones of the given type.
|
void |
delete()
Mark this message as deleted, removing it from the parent folder.
|
Address[] |
getFrom()
Returns the "From" attribute.
|
Message |
reply(boolean replyToAll)
Get a new Message suitable for a reply to this message.
|
void |
setFrom(Address address)
Set the "From" attribute in this Message.
|
void |
writeTo(Stream stream)
Writes this part to the given Stream.
|
getContent, getContentType, setContent, setContent, setContent, setTextpublic java.lang.String subject
protected Vector vFrom
protected Vector[] vRecipients
public java.lang.String uidl
public void addHeader(java.lang.String name,
java.lang.String value)
Partpublic void addRecipient(int type,
Address address)
type - the recipient typeaddress - the addressjava.lang.IllegalArgumentException - If the given recipient type is not validjava.lang.NullPointerException - if the given address is nullpublic void addRecipients(int type,
Address[] addresses)
type - the recipient typeaddresses - the addressesjava.lang.IllegalArgumentException - If the given recipient type is not validjava.lang.NullPointerException - if addresses is null, or has a null valuepublic void addFrom(Address[] addresses)
addresses - the senderspublic void setFrom(Address address)
address - the senderpublic Address[] getFrom()
public void writeTo(Stream stream) throws MessagingException
PartwriteTo in class Partstream - the output stream that will receive this part's encoded representationMessagingException - if an error occurs fetching the data to be writtenpublic void delete()
throws MessagingException
MessagingExceptionpublic Message reply(boolean replyToAll) throws AddressException
replyToAll - reply should be sent to all recipients of this messageAddressException