Package com.independentsoft.email.mime
Class Message
java.lang.Object
com.independentsoft.email.mime.Message
Class Message.
-
Constructor Summary
ConstructorsConstructorDescriptionMessage()Initializes a new instance of the Message class.Message(byte[] buffer)Initializes a new instance of the Message class.Message(InputStream stream)Initializes a new instance of the Message class.Initializes a new instance of the Message class. -
Method Summary
Modifier and TypeMethodDescriptionGets the attachments.getAttachments(boolean includeEmbedded)Gets the attachments.getBcc()Gets the bcc.getBody()Gets the body.Gets the body parts.byte[]getBytes()Gets the bytes.getCc()Gets the cc.Gets the comments.Gets the content description.Gets the content disposition.Gets the content identifier.Gets the content location.Gets the content transfer encoding.Gets the type of the content.getDate()Gets the date.Gets the embedded message.Gets the name of the file.getFrom()Gets from.Gets the full list of From mailboxes (RFC 5322 allows more than one).Gets the header character set.Gets the header encoding.Gets the headers.Gets the In-Reply-To field: one or more message identifiers (RFC 5322 section 3.6.4), e.g.Gets the keywords.Gets the message identifier.Gets the MIME version.Gets the references.Gets the reply to.Gets the Resent-Bcc mailboxes.Gets the Resent-Cc mailboxes.Gets the resent date.Gets the first Resent-From mailbox.Gets the full list of Resent-From mailboxes (RFC 5322 allows more than one).Gets the resent message identifier.Gets the resent sender.Gets the Resent-To mailboxes.Gets the return path.Gets the sender.Gets the stream.Gets the subject.getTo()Gets to.voidopen(byte[] buffer)Opens the specified buffer.voidopen(InputStream stream)Opens the specified stream.voidOpens the specified file path.voidsave(OutputStream stream)Saves the specified stream.voidSaves this message to the specified file.voidSaves this message to the specified file.voidSets the body.voidsetComments(String value)Sets the comments.voidsetContentDescription(String value)Sets the content description.voidSets the content disposition.voidsetContentID(String value)Sets the content identifier.voidsetContentLocation(String value)Sets the content location.voidSets the content transfer encoding.voidsetContentType(ContentType value)Sets the type of the content.voidSets the date.voidsetEmbeddedMessage(Message embeddedMessage)Sets the embedded message.voidSets from.voidsetHeaderCharSet(String headerCharSet)Sets the header character set.voidsetHeaderEncoding(HeaderEncoding headerEncoding)Sets the header encoding.voidsetInReplyTo(String value)Sets the In-Reply-To field.voidsetKeywords(String value)Sets the keywords.voidsetMessageID(String value)Sets the message identifier.voidsetMimeVersion(String value)Sets the MIME version.voidsetReferences(String value)Sets the references.voidsetResentDate(Date value)Sets the resent date.voidsetResentFrom(Mailbox value)Sets the first Resent-From mailbox.voidsetResentMessageID(String value)Sets the resent message identifier.voidsetResentSender(Mailbox value)Sets the resent sender.voidsetReturnPath(Mailbox value)Sets the return path.voidSets the sender.voidsetSubject(String value)Sets the subject.toString()Returns a String that represents this instance.
-
Constructor Details
-
Message
public Message()Initializes a new instance of the Message class. -
Message
Initializes a new instance of the Message class.- Parameters:
filePath- The file path.- Throws:
IOException- if an I/O error occurs.
-
Message
Initializes a new instance of the Message class.- Parameters:
stream- The stream.- Throws:
IOException- if an I/O error occurs.
-
Message
public Message(byte[] buffer)Initializes a new instance of the Message class.- Parameters:
buffer- The buffer.
-
-
Method Details
-
open
Opens the specified file path.- Parameters:
filePath- The file path.- Throws:
IOException- if an I/O error occurs.
-
open
Opens the specified stream.- Parameters:
stream- The stream.- Throws:
IOException- if an I/O error occurs.
-
open
public void open(byte[] buffer)Opens the specified buffer.- Parameters:
buffer- The buffer.
-
getAttachments
Gets the attachments.- Returns:
- Attachment array.
-
getAttachments
Gets the attachments.- Parameters:
includeEmbedded- if set to true, include embedded.- Returns:
- Attachment array.
-
getFileName
Gets the name of the file.- Returns:
- The file name.
-
save
Saves the specified stream.- Parameters:
stream- The stream.- Throws:
IOException- if an I/O error occurs.
-
save
Saves this message to the specified file.- Parameters:
filePath- File path.- Throws:
IOException- if an I/O error occurs.
-
save
Saves this message to the specified file.- Parameters:
filePath- File path.overwrite- True to overwrite existing file, otherwise false.- Throws:
IOException- if an I/O error occurs.
-
getBytes
public byte[] getBytes()Gets the bytes.- Returns:
- The bytes.
-
getStream
Gets the stream.- Returns:
- Stream.
-
toString
Returns a String that represents this instance. -
getHeaders
Gets the headers.- Returns:
- The headers.
-
getBodyParts
Gets the body parts.- Returns:
- The body parts.
-
getBody
Gets the body.- Returns:
- The body.
-
setBody
Sets the body.- Parameters:
body- The body.
-
getEmbeddedMessage
Gets the embedded message.- Returns:
- The embedded message.
-
setEmbeddedMessage
Sets the embedded message.- Parameters:
embeddedMessage- The embedded message.
-
getHeaderEncoding
Gets the header encoding.- Returns:
- The header encoding.
-
setHeaderEncoding
Sets the header encoding.- Parameters:
headerEncoding- The header encoding.
-
getHeaderCharSet
Gets the header character set.- Returns:
- The header character set.
-
setHeaderCharSet
Sets the header character set.- Parameters:
headerCharSet- The header character set.
-
getContentType
Gets the type of the content.- Returns:
- The type of the content.
-
setContentType
Sets the type of the content.- Parameters:
value- The type of the content.
-
getContentTransferEncoding
Gets the content transfer encoding.- Returns:
- The content transfer encoding.
-
setContentTransferEncoding
Sets the content transfer encoding.- Parameters:
value- The content transfer encoding.
-
getContentDisposition
Gets the content disposition.- Returns:
- The content disposition.
-
setContentDisposition
Sets the content disposition.- Parameters:
value- The content disposition.
-
getContentDescription
Gets the content description.- Returns:
- The content description.
-
setContentDescription
Sets the content description.- Parameters:
value- The content description.
-
getContentID
Gets the content identifier.- Returns:
- The content identifier.
-
setContentID
Sets the content identifier.- Parameters:
value- The content identifier.
-
getContentLocation
Gets the content location.- Returns:
- The content location.
-
setContentLocation
Sets the content location.- Parameters:
value- The content location.
-
getSubject
Gets the subject.- Returns:
- The subject.
-
setSubject
Sets the subject.- Parameters:
value- The subject.
-
getMimeVersion
Gets the MIME version.- Returns:
- The MIME version.
-
setMimeVersion
Sets the MIME version.- Parameters:
value- The MIME version.
-
getComments
Gets the comments.- Returns:
- The comments.
-
setComments
Sets the comments.- Parameters:
value- The comments.
-
getKeywords
Gets the keywords.- Returns:
- The keywords.
-
setKeywords
Sets the keywords.- Parameters:
value- The keywords.
-
getMessageID
Gets the message identifier.- Returns:
- The message identifier.
-
setMessageID
Sets the message identifier.- Parameters:
value- The message identifier.
-
getResentMessageID
Gets the resent message identifier.- Returns:
- The resent message identifier.
-
setResentMessageID
Sets the resent message identifier.- Parameters:
value- The resent message identifier.
-
getDate
Gets the date.- Returns:
- The date, or null if not present.
-
setDate
Sets the date.- Parameters:
value- The date.
-
getResentDate
Gets the resent date.- Returns:
- The resent date, or null if not present.
-
setResentDate
Sets the resent date.- Parameters:
value- The resent date.
-
getReferences
Gets the references.- Returns:
- The references.
-
setReferences
Sets the references.- Parameters:
value- The references.
-
getTo
Gets to.- Returns:
- To.
-
getCc
Gets the cc.- Returns:
- The cc.
-
getBcc
Gets the bcc.- Returns:
- The bcc.
-
getReplyTo
Gets the reply to.- Returns:
- The reply to.
-
getFrom
Gets from.- Returns:
- From.
-
setFrom
Sets from.- Parameters:
value- From.
-
getFromAddresses
Gets the full list of From mailboxes (RFC 5322 allows more than one).- Returns:
- The From mailboxes.
-
getSender
Gets the sender.- Returns:
- The sender.
-
setSender
Sets the sender.- Parameters:
value- The sender.
-
getResentFrom
Gets the first Resent-From mailbox. Resent-From is a mailbox-list (RFC 5322 section 3.6.6); use getResentFromAddresses() for the full list.- Returns:
- The first resent from mailbox.
-
setResentFrom
Sets the first Resent-From mailbox.- Parameters:
value- The first resent from mailbox.
-
getResentFromAddresses
Gets the full list of Resent-From mailboxes (RFC 5322 allows more than one).- Returns:
- The Resent-From mailboxes.
-
getResentTo
Gets the Resent-To mailboxes.- Returns:
- The Resent-To mailboxes.
-
getResentCc
Gets the Resent-Cc mailboxes.- Returns:
- The Resent-Cc mailboxes.
-
getResentBcc
Gets the Resent-Bcc mailboxes.- Returns:
- The Resent-Bcc mailboxes.
-
getResentSender
Gets the resent sender.- Returns:
- The resent sender.
-
setResentSender
Sets the resent sender.- Parameters:
value- The resent sender.
-
getInReplyTo
Gets the In-Reply-To field: one or more message identifiers (RFC 5322 section 3.6.4), e.g. "<id1@host> <id2@host>".- Returns:
- The In-Reply-To message identifiers.
-
setInReplyTo
Sets the In-Reply-To field.- Parameters:
value- The In-Reply-To message identifiers.
-
getReturnPath
Gets the return path.- Returns:
- The return path.
-
setReturnPath
Sets the return path.- Parameters:
value- The return path.
-