public class MessageHeader extends NativeObject
Constructor and Description |
---|
MessageHeader()
Constuctor.
|
MessageHeader(byte[] headersData)
The constructor will parse the data encoded using RFC 822 and initializes
the content using those data.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
allExtraHeadersNames()
Returns all the names of the custom headers.
|
java.util.List<Address> |
bcc()
Returns Bcc.
|
java.util.List<Address> |
cc()
Returns Cc.
|
java.util.Date |
date()
Returns Date.
|
java.lang.String |
extractedSubject()
Returns the extracted subject (removing all the Re:, Fwd:, etc).
|
java.lang.String |
extraHeaderValueForName(java.lang.String name)
Returns the value of a custom header.
|
MessageHeader |
forwardHeader()
Generates a header that could be used as a base for a forwarded message.
|
Address |
from()
Return From.
|
void |
importHeadersData(byte[] data)
Parsed the given data in RFC 822 format and sets the headers.
|
java.util.List<java.lang.String> |
inReplyTo()
Returns In-Reply-To.
|
boolean |
isMessageIDAutoGenerated()
Returns whether the Message-ID has been generated.
|
java.lang.String |
messageID()
Returns the Message-ID.
|
java.lang.String |
partialExtractedSubject()
Returns extracted subject but do not remove brackets.
|
java.util.Date |
receivedDate()
Sets the received date (it's not part of the RFC 822 headers).
|
java.util.List<java.lang.String> |
references()
Returns the References.
|
void |
removeExtraHeader(java.lang.String name)
Remove a custom header.
|
MessageHeader |
replyHeader(boolean replyAll,
java.util.List<Address> excludedRecipients)
Generates a header that could be used for a reply message.
|
java.util.List<Address> |
replyTo()
Returns Reply-To.
|
Address |
sender()
Returns Sender.
|
void |
setBcc(java.util.List<Address> bcc)
Sets Bcc.
|
void |
setCc(java.util.List<Address> cc)
Sets Cc.
|
void |
setDate(java.util.Date date)
Sets Date.
|
void |
setExtraHeader(java.lang.String name,
java.lang.String value)
Sets a custom header value.
|
void |
setFrom(Address from)
Sets From.
|
void |
setInReplyTo(java.util.List<java.lang.String> inReplyTo)
Sets In-Reply-To.
|
void |
setMessageID(java.lang.String messageID)
Sets the Message-ID.
|
void |
setReceivedDate(java.util.Date date)
Returns the received date (it's not part of the RFC 822 headers).
|
void |
setReferences(java.util.List<java.lang.String> references)
Sets the References.
|
void |
setReplyTo(java.util.List<Address> replyTo)
Sets Reply-To.
|
void |
setSender(Address sender)
Set Sender.
|
void |
setSubject(java.lang.String subject)
Sets Subject.
|
void |
setTo(java.util.List<Address> to)
Sets To.
|
void |
setUserAgent(java.lang.String userAgent)
Sets X-Mailer.
|
java.lang.String |
subject()
Returns Subject.
|
java.util.List<Address> |
to()
Returns To.
|
java.lang.String |
userAgent()
Returns X-Mailer.
|
clone, finalize, initWithNative, readObject, toString, writeObject
public MessageHeader()
public MessageHeader(byte[] headersData)
public java.lang.String messageID()
public void setMessageID(java.lang.String messageID)
public boolean isMessageIDAutoGenerated()
public java.util.List<java.lang.String> references()
public void setReferences(java.util.List<java.lang.String> references)
public java.util.List<java.lang.String> inReplyTo()
public void setInReplyTo(java.util.List<java.lang.String> inReplyTo)
public java.util.Date date()
public void setDate(java.util.Date date)
public java.util.Date receivedDate()
public void setReceivedDate(java.util.Date date)
public Address sender()
public void setSender(Address sender)
public Address from()
public void setFrom(Address from)
public java.util.List<Address> to()
public void setTo(java.util.List<Address> to)
public java.util.List<Address> cc()
public void setCc(java.util.List<Address> cc)
public java.util.List<Address> bcc()
public void setBcc(java.util.List<Address> bcc)
public java.util.List<Address> replyTo()
public void setReplyTo(java.util.List<Address> replyTo)
public java.lang.String subject()
public void setSubject(java.lang.String subject)
public java.lang.String userAgent()
public void setUserAgent(java.lang.String userAgent)
public void setExtraHeader(java.lang.String name, java.lang.String value)
public void removeExtraHeader(java.lang.String name)
public java.lang.String extraHeaderValueForName(java.lang.String name)
public java.util.List<java.lang.String> allExtraHeadersNames()
public java.lang.String extractedSubject()
public java.lang.String partialExtractedSubject()
public void importHeadersData(byte[] data)
public MessageHeader replyHeader(boolean replyAll, java.util.List<Address> excludedRecipients)
public MessageHeader forwardHeader()