EmlSaveOptions

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

public class EmlSaveOptions extends SaveOptions

Allows to specify additional options when saving MailMessage to Eml and Emlx format.


The following example shows how to load and Save an EML message Preserving the embedded message format.

[Java]

MailMessage mailMessage = MailMessage.load("source.eml");
 // Save as eml with preserved embedded message format
 EmlSaveOptions emlSaveOptions = new EmlSaveOptions(MailMessageSaveType.getEmlFormat())
 emlSaveOptions.setPreserveEmbeddedMessageFormat(true);
 mailMessage.save("target.eml", emlSaveOptions);

Constructors

ConstructorDescription
EmlSaveOptions(MailMessageSaveType saveType)Initializes a new instance of this class that can be used to save a MailMessage in the Eml and Emlx format.

Methods

MethodDescription
createSaveOptions(MailMessageSaveType saveType)Creates a save options object of a class suitable for the specified save type.
equals(Object arg0)
getCheckBodyContentEncoding()Defines whether need check message body content encoding when saving.
getClass()
getCustomProgressHandler()Represents method that usually supplied by calling side and handles progress events.
getDefaultEml()Gets options with default values for saving message to Eml format.
getDefaultEmlx()Gets options with default values for saving message to Emlx format.
getDefaultHtml()Gets options with default values for saving message to Html format.
getDefaultMhtml()Gets options with default values for saving message to Mhtml format.
getDefaultMsg()Gets options with default values for saving message to Msg(ASCII) format.
getDefaultMsgUnicode()Gets options with default values for saving message to Msg(Unicode) format.
getDefaultOft()Gets options with default values for saving message to Outlook template (Oft) format.
getFileCompatibilityMode()Defines inner conversions,that are necessarily to be done when saving a message.
getMailMessageSaveType()Represents the mail message save type.It can be in eml,msg(ASCII or Unicode),mhtml or html format.
getPreserveEmbeddedMessageFormat()Gets or sets a value indicating whether it is necessary to preserve MSG format of embedded message at converting to MailMessage.
getPreserveSignedContent()Gets or sets a value indicating whether it is necessary to save signed message without changes of content to provide correctly structure of digital sign.
hashCode()
notify()
notifyAll()
setCheckBodyContentEncoding(boolean value)Defines whether need check message body content encoding when saving.
setCustomProgressHandler(ConversionProgressEventHandler value)Represents method that usually supplied by calling side and handles progress events.
setFileCompatibilityMode(int value)Defines inner conversions,that are necessarily to be done when saving a message.
setMailMessageSaveType(MailMessageSaveType value)Represents the mail message save type.It can be in eml,msg(ASCII or Unicode),mhtml or html format.
setPreserveEmbeddedMessageFormat(boolean value)Gets or sets a value indicating whether it is necessary to preserve MSG format of embedded message at converting to MailMessage.
setPreserveSignedContent(boolean value)Gets or sets a value indicating whether it is necessary to save signed message without changes of content to provide correctly structure of digital sign.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

EmlSaveOptions(MailMessageSaveType saveType)

public EmlSaveOptions(MailMessageSaveType saveType)

Initializes a new instance of this class that can be used to save a MailMessage in the Eml and Emlx format.

Parameters:

ParameterTypeDescription
saveTypeMailMessageSaveType

createSaveOptions(MailMessageSaveType saveType)

public static SaveOptions createSaveOptions(MailMessageSaveType saveType)

Creates a save options object of a class suitable for the specified save type.

Parameters:

ParameterTypeDescription
saveTypeMailMessageSaveTypeThe MailMessageSaveTypesave type (#getMailMessageSaveType.getMailMessageSaveType/#setMailMessageSaveType(MailMessageSaveType).setMailMessageSaveType(MailMessageSaveType)) for which to create a save options object.

Returns: SaveOptions - An object of a class that derives from SaveOptions.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getCheckBodyContentEncoding()

public final boolean getCheckBodyContentEncoding()

Defines whether need check message body content encoding when saving. By default the value is false.


If true, it will be check whether the MailMessage.HtmlBody (MailMessage.getHtmlBody/MailMessage.setHtmlBody(String)) content encoding matches to the encoding specified by the MailMessage.BodyEncoding (MailMessage.getBodyEncoding/MailMessage.setBodyEncoding(Encoding)) property. If the HtmlBody content encoding doesn’t match BodyEncoding property, the MailMessage.BodyEncoding (MailMessage.getBodyEncoding/MailMessage.setBodyEncoding(Encoding)) and MailMessage.PreferredTextEncoding (MailMessage.getPreferredTextEncoding/MailMessage.setPreferredTextEncoding(Encoding)) will be changed to default System.Text.Encoding.UTF8 (java.nio.charset.Charset#getUTF8.getUTF8).

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCustomProgressHandler()

public final ConversionProgressEventHandler getCustomProgressHandler()

Represents method that usually supplied by calling side and handles progress events.

Returns: ConversionProgressEventHandler

getDefaultEml()

public static EmlSaveOptions getDefaultEml()

Gets options with default values for saving message to Eml format.

Returns: EmlSaveOptions

getDefaultEmlx()

public static EmlSaveOptions getDefaultEmlx()

Gets options with default values for saving message to Emlx format.

Returns: EmlSaveOptions

getDefaultHtml()

public static HtmlSaveOptions getDefaultHtml()

Gets options with default values for saving message to Html format.

Returns: HtmlSaveOptions

getDefaultMhtml()

public static MhtSaveOptions getDefaultMhtml()

Gets options with default values for saving message to Mhtml format.

Returns: MhtSaveOptions

getDefaultMsg()

public static MsgSaveOptions getDefaultMsg()

Gets options with default values for saving message to Msg(ASCII) format.

Returns: MsgSaveOptions

getDefaultMsgUnicode()

public static MsgSaveOptions getDefaultMsgUnicode()

Gets options with default values for saving message to Msg(Unicode) format.

Returns: MsgSaveOptions

getDefaultOft()

public static MsgSaveOptions getDefaultOft()

Gets options with default values for saving message to Outlook template (Oft) format.

Returns: MsgSaveOptions

getFileCompatibilityMode()

public final int getFileCompatibilityMode()

Defines inner conversions,that are necessarily to be done when saving a message. The default value is FileCompatibilityMode.None.

Returns: int

getMailMessageSaveType()

public final MailMessageSaveType getMailMessageSaveType()

Represents the mail message save type.It can be in eml,msg(ASCII or Unicode),mhtml or html format. The default value is Eml.

Returns: MailMessageSaveType

getPreserveEmbeddedMessageFormat()

public final boolean getPreserveEmbeddedMessageFormat()

Gets or sets a value indicating whether it is necessary to preserve MSG format of embedded message at converting to MailMessage. By default the value is false.


Generally, embedded messages have the same format (EML or MSG) as the underlying message. By default, when converting from MSG to EML and vice versa, embedded messages are also converted to the target format. Setting the property to true preserves the original format of embedded messages.

Returns: boolean

getPreserveSignedContent()

public final boolean getPreserveSignedContent()

Gets or sets a value indicating whether it is necessary to save signed message without changes of content to provide correctly structure of digital sign. By default the value is false.


The property is only meaningful for signed messages; it has no effect on unsigned messages. This property is intended for some complex signed messages with detached signature generated by other clients, whose implementation differences prevent Aspose.Email from exactly replicating their MIME content generation. Saving such messages without using PreserveSignedContent will cause the signature in the saved messages to fail. Some simple messages and messages with an attached signature can be saved correctly without using this property.

Returns: boolean

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setCheckBodyContentEncoding(boolean value)

public final void setCheckBodyContentEncoding(boolean value)

Defines whether need check message body content encoding when saving. By default the value is false.


If true, it will be check whether the MailMessage.HtmlBody (MailMessage.getHtmlBody/MailMessage.setHtmlBody(String)) content encoding matches to the encoding specified by the MailMessage.BodyEncoding (MailMessage.getBodyEncoding/MailMessage.setBodyEncoding(Encoding)) property. If the HtmlBody content encoding doesn’t match BodyEncoding property, the MailMessage.BodyEncoding (MailMessage.getBodyEncoding/MailMessage.setBodyEncoding(Encoding)) and MailMessage.PreferredTextEncoding (MailMessage.getPreferredTextEncoding/MailMessage.setPreferredTextEncoding(Encoding)) will be changed to default System.Text.Encoding.UTF8 (java.nio.charset.Charset#getUTF8.getUTF8).

Parameters:

ParameterTypeDescription
valueboolean

setCustomProgressHandler(ConversionProgressEventHandler value)

public final void setCustomProgressHandler(ConversionProgressEventHandler value)

Represents method that usually supplied by calling side and handles progress events.

Parameters:

ParameterTypeDescription
valueConversionProgressEventHandler

setFileCompatibilityMode(int value)

public final void setFileCompatibilityMode(int value)

Defines inner conversions,that are necessarily to be done when saving a message. The default value is FileCompatibilityMode.None.

Parameters:

ParameterTypeDescription
valueint

setMailMessageSaveType(MailMessageSaveType value)

public final void setMailMessageSaveType(MailMessageSaveType value)

Represents the mail message save type.It can be in eml,msg(ASCII or Unicode),mhtml or html format. The default value is Eml.

Parameters:

ParameterTypeDescription
valueMailMessageSaveType

setPreserveEmbeddedMessageFormat(boolean value)

public final void setPreserveEmbeddedMessageFormat(boolean value)

Gets or sets a value indicating whether it is necessary to preserve MSG format of embedded message at converting to MailMessage. By default the value is false.


Generally, embedded messages have the same format (EML or MSG) as the underlying message. By default, when converting from MSG to EML and vice versa, embedded messages are also converted to the target format. Setting the property to true preserves the original format of embedded messages.

Parameters:

ParameterTypeDescription
valueboolean

setPreserveSignedContent(boolean value)

public final void setPreserveSignedContent(boolean value)

Gets or sets a value indicating whether it is necessary to save signed message without changes of content to provide correctly structure of digital sign. By default the value is false.


The property is only meaningful for signed messages; it has no effect on unsigned messages. This property is intended for some complex signed messages with detached signature generated by other clients, whose implementation differences prevent Aspose.Email from exactly replicating their MIME content generation. Saving such messages without using PreserveSignedContent will cause the signature in the saved messages to fail. Some simple messages and messages with an attached signature can be saved correctly without using this property.

Parameters:

ParameterTypeDescription
valueboolean

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int