MailMessage

Inheritance: java.lang.Object, com.aspose.email.IPreferredTextEncodingProviderInternal

All Implemented Interfaces: com.aspose.ms.System.IDisposable, java.io.Closeable, com.aspose.email.IPreferredTextEncodingProvider, com.aspose.email.IMessage, com.aspose.ms.System.Collections.Generic.IGenericEnumerable

public class MailMessage extends IPreferredTextEncodingProviderInternal implements System.IDisposable, Closeable, IPreferredTextEncodingProvider, IMessage, System.Collections.Generic.IGenericEnumerable<MailMessage>

Represents an e-mail message. It allows to access message properties, ex. subject, body, sender and recipients addreses, etc. Also it can be sent and delivered by means of supported mail protocols.

Constructors

Constructor Description
MailMessage(String from, String to) Initializes a new instance of the MailMessage class
MailMessage() Initializes a new instance of the MailMessage class
MailMessage(boolean increaseCredit) Initializes a new instance of the MailMessage class
MailMessage(String from, String to, String subject, String body) Initializes a new instance of the MailMessage class
MailMessage(MailAddress from, MailAddress to) Initializes a new instance of the MailMessage class

Methods

Method Description
addAlternateView(AlternateView view) Add an alternate view to message
addAttachment(Attachment attachment) Add an attachment to message
attachSignature(byte[] certificateRawData, String certificatePassword) Creates a signed message.
attachSignature(byte[] certificateRawData, String certificatePassword, boolean detached) Creates a signed message.
attachSignature(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate)
attachSignature(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, boolean detached) Creates a signed message.
checkBounced() Checks whether this message can be treated as a bounce message.
checkSignature() Checking signature exsisting MailMessage.
checkSignature(InputStream stream) Checks the signature of the specified eml message.
checkSignature(String fileName) Checks the signature of the specified eml file.
checkSignatureCert() Checking signature exsisting MailMessage.
close()
createReadReceipt(String from, String bodyText) Creates the read receipt.
dKIMSign(System.Security.Cryptography.RSACryptoServiceProvider rsa, DKIMSignatureInfo signatureInfo) Signs this message using DKIM (DomainKeys Identified Mail) signature.
decrypt() Decrypts this message
decrypt(byte[] certificateRawData, String certificatePassword) Decrypts this message
decrypt(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate)
deepClone() Clones this instance
dispose() Releases all resources used by the MailMessage
encrypt(byte[] certificateRawData, String certificatePassword) Encrypts this message
encrypt(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate)
encrypt(System.Security.Cryptography.X509Certificates.X509Certificate2[] certificates) Encrypts this message
equals(Object obj) Determines whether the specified Object is equal to the current Object.
getAlternateViews() Gets the collection of alternate views of message
getAttachments() Gets the collection of attachments of message
getBcc() Gets or sets the address collection that contains the BCC recipients of message
getBody() Gets or sets the plain text representation of message’s body.
getBodyEncoding() Gets or sets encoding of body
getBodyType() Gets the type of the body.
getCC() Gets or sets the address collection that contains the CC recipients
getCc() Gets CC recipients
getClass()
getDate() Gets or sets the date of message Specifies the date and time at which the creator of the message indicated that the message was complete and ready to enter the mail delivery system.
getDeliveryNotificationOptions() Gets or sets the delivery notifications
getEpilogue() Gets or sets an epilogue text.
getFrom() Gets or sets the from address
getHeaders() Gets headers collection of message
getHtmlBody() Gets or sets html body
getHtmlBodyText() Gets the message htmlbody as plain text.
getHtmlBodyText(boolean showUrl) Gets the message html body as plain text.
getHtmlBodyText(HyperlinkRenderingCallback hyperlinkRenderingCallback) Gets the message htmlbody as plain text.
getItemId() Represents identification information about message in a mailbox.
getLinkedResources() Gets the collection of linked resources of message
getLocalDate() Gets the local date of message
getMessageId() Gets or sets the message id
getOriginalIsTnef() Gets a value indicating whether original EML message is in TNEF format.
getPreamble() Gets or sets a preamble text.
getPreferredTextEncoding() Gets or sets preferred encoding for all text properties
getPriority() Gets or sets the priority of message
getReadReceiptTo() Gets or sets the read receipt address.
getReplyToList() Gets or sets the list of addresses to reply to for the mail message
getReversePath() Gets or sets ReversePath address
getSender() Gets or sets sender address
getSensitivity() Gets or sets the sensitivity of message
getSubject() Gets or sets the subject line
getSubjectEncoding() Gets or sets the encoding of subject
getTimeZoneOffset() Gets or sets the Coordinated Universal Time (UTC) offset for the message dates.
getTo() Gets or sets the address collection that contains the recipients of message
getXMailer() Gets or sets the X-Mailer the software that created the e-mail message
hashCode() Returns a hash code for object
importMessage(InputStream stream) Imports message from stream
isBodyHtml() Gets or sets a value indicating whether the message body is in Html
isBodyHtml(boolean value) Gets or sets a value indicating whether the message body is in Html
isDraft() Gets or sets value that indicates whether or not a message has been sent.
isDraft(boolean value) Gets or sets value that indicates whether or not a message has been sent.
isEncrypted() Gets a value indicating whether the message is encrypted.
isLocalDate() Defines if date is local date
isReadOnly() Gets a value indicating whether the message is read only
isSigned() Gets a value indicating whether the message is signed.
iterator() Returns an enumerator that iterates through a collection.
load(InputStream stream) Load message from stream
load(InputStream stream, LoadOptions options) Load message from stream with additional options.
load(String fileName) Load message from file
load(String fileName, LoadOptions options) Load message from file with additional options.
notify()
notifyAll()
recomposeTnefContent() Composes the TNEF content.
removeSignature() Remove signature
save(OutputStream stream) Save message as a stream
save(OutputStream stream, SaveOptions options) Save message as a stream with additional options.
save(String fileName) Save message as a file
save(String fileName, SaveOptions options) Save message as a file with additional options.
setBcc(MailAddressCollection value) Gets or sets the address collection that contains the BCC recipients of message
setBody(String value) Gets or sets the plain text representation of message’s body.
setBodyEncoding(Charset value) Gets or sets encoding of body
setCC(MailAddressCollection value) Gets or sets the address collection that contains the CC recipients
setDate(Date value) Gets or sets the date of message
setDeliveryNotificationOptions(int value) Gets or sets the delivery notifications
setEpilogue(String value) Gets or sets an epilogue text.
setFrom(IMailAddress value) Sets from address
setFrom(MailAddress value) Gets or sets the from address
setHtmlBody(String value) Gets or sets html body
setHtmlBody(String value, boolean detectEncoding) Sets html body.
setMessageId(String value) Gets or sets the message id
setPreamble(String value) Gets or sets a preamble text.
setPreferredTextEncoding(Charset value) Gets or sets preferred encoding for all text properties
setPriority(MailPriority value) Gets or sets the priority of message
setReadReceiptTo(MailAddressCollection value) Gets or sets the read receipt address.
setReplyToList(MailAddressCollection value) Gets or sets the list of addresses to reply to for the mail message
setReversePath(MailAddress value) Gets or sets ReversePath address
setSender(MailAddress value) Gets or sets sender address
setSensitivity(MailSensitivity value) Gets or sets the sensitivity of message
setSubject(String value) Gets or sets the subject line
setSubjectEncoding(Charset value) Gets or sets the encoding of subject
setTimeZoneOffset(double value) Gets or sets the Coordinated Universal Time (UTC) offset for the message dates.
setTo(MailAddressCollection value) Gets or sets the address collection that contains the recipients of message
setXMailer(String value) Gets or sets the X-Mailer the software that created the e-mail message
toString() Returns a string that represents the current object.
validateMessage(InputStream stream) Validate eml message for corresponding to mime specification.
validateMessage(String fileName) Validate eml message for corresponding to mime specification.
wait()
wait(long arg0)
wait(long arg0, int arg1)

MailMessage(String from, String to)

public MailMessage(String from, String to)

Initializes a new instance of the MailMessage class

Parameters:

Parameter Type Description
from java.lang.String Sender address
to java.lang.String Recipient address

MailMessage()

public MailMessage()

Initializes a new instance of the MailMessage class

MailMessage(boolean increaseCredit)

public MailMessage(boolean increaseCredit)

Initializes a new instance of the MailMessage class

Parameters:

Parameter Type Description
increaseCredit boolean

MailMessage(String from, String to, String subject, String body)

public MailMessage(String from, String to, String subject, String body)

Initializes a new instance of the MailMessage class

Parameters:

Parameter Type Description
from java.lang.String Sender address
to java.lang.String Recipient address
subject java.lang.String Message subject
body java.lang.String Message body

MailMessage(MailAddress from, MailAddress to)

public MailMessage(MailAddress from, MailAddress to)

Initializes a new instance of the MailMessage class

Parameters:

Parameter Type Description
from MailAddress Sender address
to MailAddress Recipient address

addAlternateView(AlternateView view)

public void addAlternateView(AlternateView view)

Add an alternate view to message

Parameters:

Parameter Type Description
view AlternateView Alternate view for adding

addAttachment(Attachment attachment)

public void addAttachment(Attachment attachment)

Add an attachment to message

Parameters:

Parameter Type Description
attachment Attachment Attachment for adding

attachSignature(byte[] certificateRawData, String certificatePassword)

public MailMessage attachSignature(byte[] certificateRawData, String certificatePassword)

Creates a signed message. Creates a read-only copy of the specified MailMessage and adds a digital signature to it.

Parameters:

Parameter Type Description
certificateRawData byte[] X.509 certificate.
certificatePassword java.lang.String The password required to access the X.509 certificate data

Returns: MailMessage - The signed MailMessage.

attachSignature(byte[] certificateRawData, String certificatePassword, boolean detached)

public MailMessage attachSignature(byte[] certificateRawData, String certificatePassword, boolean detached)

Creates a signed message. Creates a read-only copy of the specified MailMessage and adds a digital signature to it.

Parameters:

Parameter Type Description
certificateRawData byte[] X.509 certificate.
certificatePassword java.lang.String The password required to access the X.509 certificate data
detached boolean .If detached is true, the signature is detached.If detached is false(the default), the signature is not detached.

Returns: MailMessage - The signed MailMessage.

attachSignature(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate)

public MailMessage attachSignature(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate)

Parameters:

Parameter Type Description
certificate com.aspose.ms.System.Security.Cryptography.X509Certificates.X509Certificate2

Returns: MailMessage

attachSignature(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, boolean detached)

public MailMessage attachSignature(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, boolean detached)

Creates a signed message. Creates a read-only copy of the specified MailMessage and adds a digital signature to it.

Parameters:

Parameter Type Description
certificate com.aspose.ms.System.Security.Cryptography.X509Certificates.X509Certificate2 X.509 certificate.
detached boolean .If detached is true, the signature is detached.If detached is false(the default), the signature is not detached.

Returns: MailMessage -

checkBounced()

public BounceResult checkBounced()

Checks whether this message can be treated as a bounce message.

Returns: BounceResult - Result of checkingBounceResult.

checkSignature()

public String[] checkSignature()

Checking signature exsisting MailMessage.

Returns: java.lang.String[] - X.509 signers certificates

checkSignature(InputStream stream)

public static boolean checkSignature(InputStream stream)

Checks the signature of the specified eml message.

Parameters:

Parameter Type Description
stream java.io.InputStream A stream containing the message in eml format.

Returns: boolean - True if signature is valid; otherwise, false .

checkSignature(String fileName)

public static boolean checkSignature(String fileName)

Checks the signature of the specified eml file.

Parameters:

Parameter Type Description
fileName java.lang.String A file name (eml).

Returns: boolean - True if signature is valid; otherwise, false .

checkSignatureCert()

public System.Security.Cryptography.X509Certificates.X509Certificate2[] checkSignatureCert()

Checking signature exsisting MailMessage.

Returns: com.aspose.ms.System.Security.Cryptography.X509Certificates.X509Certificate2[] - X.509 signers certificates

close()

public void close()

createReadReceipt(String from, String bodyText)

public final MailMessage createReadReceipt(String from, String bodyText)

Creates the read receipt.

Parameters:

Parameter Type Description
from java.lang.String String that represents the sender address.
bodyText java.lang.String The message body text. The default message body text will be applied if this parameter is null or empty.

Returns: MailMessage - A newly created MailMessage that represents the read receipt.

dKIMSign(System.Security.Cryptography.RSACryptoServiceProvider rsa, DKIMSignatureInfo signatureInfo)

public MailMessage dKIMSign(System.Security.Cryptography.RSACryptoServiceProvider rsa, DKIMSignatureInfo signatureInfo)

Signs this message using DKIM (DomainKeys Identified Mail) signature.

Parameters:

Parameter Type Description
rsa com.aspose.ms.System.Security.Cryptography.RSACryptoServiceProvider RSA class containing private key used for signing.
signatureInfo DKIMSignatureInfo DKIM signature information.

Returns: MailMessage -

decrypt()

public MailMessage decrypt()

Decrypts this message

Returns: MailMessage - E-mail message

decrypt(byte[] certificateRawData, String certificatePassword)

public MailMessage decrypt(byte[] certificateRawData, String certificatePassword)

Decrypts this message

Parameters:

Parameter Type Description
certificateRawData byte[] System.Security.Cryptography.X509Certificates.X509Certificate2
certificatePassword java.lang.String The password required to access the X.509 certificate data

Returns: MailMessage - E-mail message

decrypt(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate)

public MailMessage decrypt(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate)

Parameters:

Parameter Type Description
certificate com.aspose.ms.System.Security.Cryptography.X509Certificates.X509Certificate2

Returns: MailMessage

deepClone()

public MailMessage deepClone()

Clones this instance

Returns: MailMessage - MailMessage that is a copy of the current instance

dispose()

public final void dispose()

Releases all resources used by the MailMessage

encrypt(byte[] certificateRawData, String certificatePassword)

public MailMessage encrypt(byte[] certificateRawData, String certificatePassword)

Encrypts this message

Parameters:

Parameter Type Description
certificateRawData byte[] X509 certificate to encrypt message
certificatePassword java.lang.String

Returns: MailMessage - Encrypted email message

encrypt(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate)

public MailMessage encrypt(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate)

Parameters:

Parameter Type Description
certificate com.aspose.ms.System.Security.Cryptography.X509Certificates.X509Certificate2

Returns: MailMessage

encrypt(System.Security.Cryptography.X509Certificates.X509Certificate2[] certificates)

public MailMessage encrypt(System.Security.Cryptography.X509Certificates.X509Certificate2[] certificates)

Encrypts this message

Parameters:

Parameter Type Description
certificates com.aspose.ms.System.Security.Cryptography.X509Certificates.X509Certificate2[] Array with X509 certificates to encrypt message

Returns: MailMessage - Encrypted email message

equals(Object obj)

public boolean equals(Object obj)

Determines whether the specified Object is equal to the current Object.

Parameters:

Parameter Type Description
obj java.lang.Object The Object to compare with the current Object.

Returns: boolean - Returns a boolean indicating if the passed in object obj is Equal to this.

getAlternateViews()

public AlternateViewCollection getAlternateViews()

Gets the collection of alternate views of message

Returns: AlternateViewCollection

getAttachments()

public AttachmentCollection getAttachments()

Gets the collection of attachments of message

Returns: AttachmentCollection

getBcc()

public MailAddressCollection getBcc()

Gets or sets the address collection that contains the BCC recipients of message

Returns: MailAddressCollection

getBody()

public String getBody()

Gets or sets the plain text representation of message’s body. If the text/plain part is present in a message, the propery returns its text data. Otherwise, property returns the text content of the HtmlBody property without html markup.

Returns: java.lang.String

getBodyEncoding()

public Charset getBodyEncoding()

Gets or sets encoding of body

Returns: java.nio.charset.Charset

getBodyType()

public final int getBodyType()

Gets the type of the body.

Returns: int

getCC()

public MailAddressCollection getCC()

Gets or sets the address collection that contains the CC recipients

Returns: MailAddressCollection

getCc()

public final System.Collections.Generic.IGenericCollection<MailAddress> getCc()

Gets CC recipients

Returns: com.aspose.ms.System.Collections.Generic.IGenericCollection<com.aspose.email.MailAddress>

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getDate()

public Date getDate()

Gets or sets the date of message Specifies the date and time at which the creator of the message indicated that the message was complete and ready to enter the mail delivery system.

Returns: java.util.Date

getDeliveryNotificationOptions()

public int getDeliveryNotificationOptions()

Gets or sets the delivery notifications

Returns: int

getEpilogue()

public final String getEpilogue()

Gets or sets an epilogue text. It is located after the last boundary.

Value: The string value that represents an epilogue.

Returns: java.lang.String

getFrom()

public MailAddress getFrom()

Gets or sets the from address

Returns: MailAddress

getHeaders()

public HeaderCollection getHeaders()

Gets headers collection of message

Returns: HeaderCollection

getHtmlBody()

public String getHtmlBody()

Gets or sets html body

Returns: java.lang.String

getHtmlBodyText()

public final String getHtmlBodyText()

Gets the message htmlbody as plain text.

Returns: java.lang.String

getHtmlBodyText(boolean showUrl)

public String getHtmlBodyText(boolean showUrl)

Gets the message html body as plain text. This method parses the HtmlBody property and returns plain text content ignoring the html markup.

Parameters:

Parameter Type Description
showUrl boolean Defines need to show URL in text.

Returns: java.lang.String

getHtmlBodyText(HyperlinkRenderingCallback hyperlinkRenderingCallback)

public String getHtmlBodyText(HyperlinkRenderingCallback hyperlinkRenderingCallback)

Gets the message htmlbody as plain text.

Parameters:

Parameter Type Description
hyperlinkRenderingCallback HyperlinkRenderingCallback Reference to custom method for handling rendering of hyperlink.

Returns: java.lang.String - Result string of custom handling rendering of hyperlink.

getItemId()

public MailboxInfo getItemId()

Represents identification information about message in a mailbox.

Returns: MailboxInfo

getLinkedResources()

public LinkedResourceCollection getLinkedResources()

Gets the collection of linked resources of message

Returns: LinkedResourceCollection

getLocalDate()

public Date getLocalDate()

Gets the local date of message

Returns: java.util.Date - A local date of message

getMessageId()

public String getMessageId()

Gets or sets the message id

Returns: java.lang.String

getOriginalIsTnef()

public boolean getOriginalIsTnef()

Gets a value indicating whether original EML message is in TNEF format.

Returns: boolean

getPreamble()

public final String getPreamble()

Gets or sets a preamble text. It is located before the first boundary and generally includes an explanatory note to non-MIME conformant readers.

Value: The string value that represents a preamble.

Returns: java.lang.String

getPreferredTextEncoding()

public final Charset getPreferredTextEncoding()

Gets or sets preferred encoding for all text properties

Returns: java.nio.charset.Charset

getPriority()

public MailPriority getPriority()

Gets or sets the priority of message

Returns: MailPriority

getReadReceiptTo()

public final MailAddressCollection getReadReceiptTo()

Gets or sets the read receipt address.

Value: The MailAddressCollection that represents

Returns: MailAddressCollection

getReplyToList()

public MailAddressCollection getReplyToList()

Gets or sets the list of addresses to reply to for the mail message

Returns: MailAddressCollection

getReversePath()

public MailAddress getReversePath()

Gets or sets ReversePath address

Returns: MailAddress

getSender()

public MailAddress getSender()

Gets or sets sender address

Returns: MailAddress

getSensitivity()

public MailSensitivity getSensitivity()

Gets or sets the sensitivity of message

Returns: MailSensitivity

getSubject()

public String getSubject()

Gets or sets the subject line

Returns: java.lang.String

getSubjectEncoding()

public Charset getSubjectEncoding()

Gets or sets the encoding of subject

Returns: java.nio.charset.Charset

getTimeZoneOffset()

public final double getTimeZoneOffset()

Gets or sets the Coordinated Universal Time (UTC) offset for the message dates. This property defines the time zone difference, between the local time and UTC.

Returns: double - A number of milliseconds.

getTo()

public MailAddressCollection getTo()

Gets or sets the address collection that contains the recipients of message

Returns: MailAddressCollection

getXMailer()

public String getXMailer()

Gets or sets the X-Mailer the software that created the e-mail message

Returns: java.lang.String

hashCode()

public int hashCode()

Returns a hash code for object

Returns: int -

importMessage(InputStream stream)

public void importMessage(InputStream stream)

Imports message from stream

Parameters:

Parameter Type Description
stream java.io.InputStream System.IO.Stream

isBodyHtml()

public boolean isBodyHtml()

Gets or sets a value indicating whether the message body is in Html

Returns: boolean

isBodyHtml(boolean value)

public void isBodyHtml(boolean value)

Gets or sets a value indicating whether the message body is in Html

Parameters:

Parameter Type Description
value boolean

isDraft()

public boolean isDraft()

Gets or sets value that indicates whether or not a message has been sent.

Returns: boolean

isDraft(boolean value)

public void isDraft(boolean value)

Gets or sets value that indicates whether or not a message has been sent.

Parameters:

Parameter Type Description
value boolean

isEncrypted()

public boolean isEncrypted()

Gets a value indicating whether the message is encrypted.

Returns: boolean

isLocalDate()

public boolean isLocalDate()

Defines if date is local date

Returns: boolean - true if date is local date

isReadOnly()

public boolean isReadOnly()

Gets a value indicating whether the message is read only

Returns: boolean

isSigned()

public boolean isSigned()

Gets a value indicating whether the message is signed.

Returns: boolean

iterator()

public final System.Collections.Generic.IGenericEnumerator<MailMessage> iterator()

Returns an enumerator that iterates through a collection.

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.email.MailMessage> - An IEnumerator object that can be used to iterate through the collection.

load(InputStream stream)

public static MailMessage load(InputStream stream)

Load message from stream

Parameters:

Parameter Type Description
stream java.io.InputStream Stream that represents message in eml or msg format

Returns: MailMessage - E-mail message

load(InputStream stream, LoadOptions options)

public static MailMessage load(InputStream stream, LoadOptions options)

Load message from stream with additional options.

Parameters:

Parameter Type Description
stream java.io.InputStream Source streamjava.io.InputStream.
options LoadOptions Additional options LoadOptions.

Returns: MailMessage - Mail messageMailMessage.

load(String fileName)

public static MailMessage load(String fileName)

Load message from file

Parameters:

Parameter Type Description
fileName java.lang.String Message file name. The message file must be in eml or msg format.

Returns: MailMessage - E-mail message

load(String fileName, LoadOptions options)

public static MailMessage load(String fileName, LoadOptions options)

Load message from file with additional options.

Parameters:

Parameter Type Description
fileName java.lang.String Source file pathString.
options LoadOptions Additional options LoadOptions.

Returns: MailMessage - Mail messageMailMessage.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

recomposeTnefContent()

public final void recomposeTnefContent()

Composes the TNEF content. Note, that tnef attachment is composed if a message initially contained TNEF and was loaded without FileCompatibilityMode.PreserveTnefAttachments flag, That is this method doesn’t create tnef message out of the regular one.

removeSignature()

public MailMessage removeSignature()

Remove signature

Returns: MailMessage - E-mail message

save(OutputStream stream)

public void save(OutputStream stream)

Save message as a stream

Parameters:

Parameter Type Description
stream java.io.OutputStream Stream into which message is saved

save(OutputStream stream, SaveOptions options)

public void save(OutputStream stream, SaveOptions options)

Save message as a stream with additional options.

Parameters:

Parameter Type Description
stream java.io.OutputStream Stream into which message is saved.
options SaveOptions Additional options for savingSaveOptions.

save(String fileName)

public void save(String fileName)

Save message as a file

Parameters:

Parameter Type Description
fileName java.lang.String Name of a file to save message.

save(String fileName, SaveOptions options)

public void save(String fileName, SaveOptions options)

Save message as a file with additional options.

Parameters:

Parameter Type Description
fileName java.lang.String Stream into which message is saved.
options SaveOptions Additional options for savingSaveOptions.

setBcc(MailAddressCollection value)

public void setBcc(MailAddressCollection value)

Gets or sets the address collection that contains the BCC recipients of message

Parameters:

Parameter Type Description
value MailAddressCollection

setBody(String value)

public void setBody(String value)

Gets or sets the plain text representation of message’s body. If the text/plain part is present in a message, the propery returns its text data. Otherwise, property returns the text content of the HtmlBody property without html markup.

Parameters:

Parameter Type Description
value java.lang.String

setBodyEncoding(Charset value)

public void setBodyEncoding(Charset value)

Gets or sets encoding of body

Parameters:

Parameter Type Description
value java.nio.charset.Charset

setCC(MailAddressCollection value)

public void setCC(MailAddressCollection value)

Gets or sets the address collection that contains the CC recipients

Parameters:

Parameter Type Description
value MailAddressCollection

setDate(Date value)

public void setDate(Date value)

Gets or sets the date of message

Parameters:

Parameter Type Description
value java.util.Date

setDeliveryNotificationOptions(int value)

public void setDeliveryNotificationOptions(int value)

Gets or sets the delivery notifications

Parameters:

Parameter Type Description
value int

setEpilogue(String value)

public final void setEpilogue(String value)

Gets or sets an epilogue text. It is located after the last boundary.

Value: The string value that represents an epilogue.

Parameters:

Parameter Type Description
value java.lang.String

setFrom(IMailAddress value)

public final void setFrom(IMailAddress value)

Sets from address

Parameters:

Parameter Type Description
value IMailAddress A from address

setFrom(MailAddress value)

public void setFrom(MailAddress value)

Gets or sets the from address

Parameters:

Parameter Type Description
value MailAddress

setHtmlBody(String value)

public void setHtmlBody(String value)

Gets or sets html body

Parameters:

Parameter Type Description
value java.lang.String

setHtmlBody(String value, boolean detectEncoding)

public void setHtmlBody(String value, boolean detectEncoding)

Sets html body.

Parameters:

Parameter Type Description
value java.lang.String The HtmlBody content text.
detectEncoding boolean Detect body encoding if no encoding is specified for the MailMessage.

setMessageId(String value)

public void setMessageId(String value)

Gets or sets the message id

Parameters:

Parameter Type Description
value java.lang.String

setPreamble(String value)

public final void setPreamble(String value)

Gets or sets a preamble text. It is located before the first boundary and generally includes an explanatory note to non-MIME conformant readers.

Value: The string value that represents a preamble.

Parameters:

Parameter Type Description
value java.lang.String

setPreferredTextEncoding(Charset value)

public final void setPreferredTextEncoding(Charset value)

Gets or sets preferred encoding for all text properties

Parameters:

Parameter Type Description
value java.nio.charset.Charset

setPriority(MailPriority value)

public void setPriority(MailPriority value)

Gets or sets the priority of message

Parameters:

Parameter Type Description
value MailPriority

setReadReceiptTo(MailAddressCollection value)

public final void setReadReceiptTo(MailAddressCollection value)

Gets or sets the read receipt address.

Value: The MailAddressCollection that represents

Parameters:

Parameter Type Description
value MailAddressCollection

setReplyToList(MailAddressCollection value)

public void setReplyToList(MailAddressCollection value)

Gets or sets the list of addresses to reply to for the mail message

Parameters:

Parameter Type Description
value MailAddressCollection

setReversePath(MailAddress value)

public void setReversePath(MailAddress value)

Gets or sets ReversePath address

Parameters:

Parameter Type Description
value MailAddress

setSender(MailAddress value)

public void setSender(MailAddress value)

Gets or sets sender address

Parameters:

Parameter Type Description
value MailAddress

setSensitivity(MailSensitivity value)

public void setSensitivity(MailSensitivity value)

Gets or sets the sensitivity of message

Parameters:

Parameter Type Description
value MailSensitivity

setSubject(String value)

public void setSubject(String value)

Gets or sets the subject line

Parameters:

Parameter Type Description
value java.lang.String

setSubjectEncoding(Charset value)

public void setSubjectEncoding(Charset value)

Gets or sets the encoding of subject

Parameters:

Parameter Type Description
value java.nio.charset.Charset

setTimeZoneOffset(double value)

public final void setTimeZoneOffset(double value)

Gets or sets the Coordinated Universal Time (UTC) offset for the message dates. This property defines the time zone difference, between the local time and UTC.

Parameters:

Parameter Type Description
value double A number of milliseconds.

setTo(MailAddressCollection value)

public void setTo(MailAddressCollection value)

Gets or sets the address collection that contains the recipients of message

Parameters:

Parameter Type Description
value MailAddressCollection

setXMailer(String value)

public void setXMailer(String value)

Gets or sets the X-Mailer the software that created the e-mail message

Parameters:

Parameter Type Description
value java.lang.String

toString()

public String toString()

Returns a string that represents the current object.

Returns: java.lang.String - A string that represents the current object.

validateMessage(InputStream stream)

public static EmlValidationErrorCollection validateMessage(InputStream stream)

Validate eml message for corresponding to mime specification.

Parameters:

Parameter Type Description
stream java.io.InputStream A stream containing the message in eml format.

Returns: EmlValidationErrorCollection - A EmlValidationErrorCollection containing the found validation error messages.

validateMessage(String fileName)

public static EmlValidationErrorCollection validateMessage(String fileName)

Validate eml message for corresponding to mime specification.

Parameters:

Parameter Type Description
fileName java.lang.String A file name (eml).

Returns: EmlValidationErrorCollection - A EmlValidationErrorCollection containing the found validation error messages.

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

Parameter Type Description
arg0 long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

Parameter Type Description
arg0 long
arg1 int