MhtSaveOptions

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

public class MhtSaveOptions extends HeadersFormattingOptions

Allows to specify additional options when saving MailMessage to Mhtml format.


The following example shows how to save MailMessage as MHTML.

[Java]

MailMessage eml = MailMessage.load("Message.eml");
 eml.save("target.mthml", SaveOptions.getDefaultMhtml());

Constructors

ConstructorDescription
MhtSaveOptions()Initializes a new instance of this class that can be used to save a MailMessage in the Mhtml format.

Methods

MethodDescription
createSaveOptions(MailMessageSaveType saveType)Creates a save options object of a class suitable for the specified save type.
equals(Object arg0)
getAfterHeadersFormat()After headers format.
getBeforeHeadersFormat()Before headers format.
getCheckBodyContentEncoding()Defines whether need check message body content encoding when saving.
getClass()
getCssStyles()Gets or sets the additional css styles for the formatter.
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.
getDefaultHeaderFormat()Default header line 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.
getDefaultPageHeaderFormat()Default page header format.
getFormatTemplates()Gets the format templates.
getMailMessageSaveType()Represents the mail message save type.It can be in eml,msg(ASCII or Unicode),mhtml or html format.
getMhtFormatOptions()Defines additional options when saving in MHTML format.
getPreserveOriginalBoundaries()Defines whether need keep original boundaries in mail message when saving or not.
getPreserveOriginalDate()Defines whether need keep original date in mail message when saving or not.
getRenderedContactFields()Defines groups of Contact fields which will be included in output mhtml.
getRenderingHeaders()Gets list of headers for rendering.
getSaveAllHeaders()Defines whether need to save all headers in output mhtml or not.
getSaveAttachments()Gets or sets a value indicating whether to save attachments.
getSavedHeaders()Gets list of headers which will be present in saved mhtml content.
getSkipInlineImages()Defines whether skip references on images at saving in mhtml or not.
getTimeout()Limits the time in milliseconds of formatting message while saving in Mht.
getTimeoutReachedHandler()Raised if timed out while saving to Mhtml.
hashCode()
notify()
notifyAll()
setAfterHeadersFormat(String value)After headers format.
setBeforeHeadersFormat(String value)Before headers format.
setCheckBodyContentEncoding(boolean value)Defines whether need check message body content encoding when saving.
setCssStyles(String value)Gets or sets the additional css styles for the formatter.
setCustomProgressHandler(ConversionProgressEventHandler value)Represents method that usually supplied by calling side and handles progress events.
setDefaultHeaderFormat(String value)Default header line format.
setDefaultPageHeaderFormat(String value)Default page header format.
setMailMessageSaveType(MailMessageSaveType value)Represents the mail message save type.It can be in eml,msg(ASCII or Unicode),mhtml or html format.
setMhtFormatOptions(int value)Defines additional options when saving in MHTML format.
setPreserveOriginalBoundaries(boolean value)Defines whether need keep original boundaries in mail message when saving or not.
setPreserveOriginalDate(boolean value)Defines whether need keep original date in mail message when saving or not.
setRenderedContactFields(int value)Defines groups of Contact fields which will be included in output mhtml.
setSaveAllHeaders(boolean value)Defines whether need to save all headers in output mhtml or not.
setSaveAttachments(boolean value)Gets or sets a value indicating whether to save attachments.
setSkipInlineImages(boolean value)Defines whether skip references on images at saving in mhtml or not.
setTimeout(int value)Limits the time in milliseconds of formatting message while saving in Mht.
setTimeoutReachedHandler(TimeoutReachedHandler value)Raised if timed out while saving to Mhtml.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

MhtSaveOptions()

public MhtSaveOptions()

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

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

getAfterHeadersFormat()

public final String getAfterHeadersFormat()

After headers format.

Value: The styles to be injected into resulting html body.

Returns: java.lang.String

getBeforeHeadersFormat()

public final String getBeforeHeadersFormat()

Before headers format.

Value: The styles to be injected into resulting html body.

Returns: java.lang.String

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)) properties 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

getCssStyles()

public final String getCssStyles()

Gets or sets the additional css styles for the formatter.

Value: The styles to be injected into resulting html body.

Returns: java.lang.String

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

getDefaultHeaderFormat()

public final String getDefaultHeaderFormat()

Default header line format.

Value: The styles to be injected into resulting html body.

Returns: java.lang.String

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

getDefaultPageHeaderFormat()

public final String getDefaultPageHeaderFormat()

Default page header format.

Value: The styles to be injected into resulting html body.

Returns: java.lang.String

getFormatTemplates()

public final System.Collections.Specialized.StringDictionary getFormatTemplates()

Gets the format templates.

Value: The format templates.

Returns: com.aspose.ms.System.Collections.Specialized.StringDictionary

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

getMhtFormatOptions()

public final int getMhtFormatOptions()

Defines additional options when saving in MHTML format. Default value is MhtFormatOptions.WriteHeader | MhtFormatOptions.WriteOutlineAttachments.

Returns: int

getPreserveOriginalBoundaries()

public final boolean getPreserveOriginalBoundaries()

Defines whether need keep original boundaries in mail message when saving or not.

Returns: boolean

getPreserveOriginalDate()

public final boolean getPreserveOriginalDate()

Defines whether need keep original date in mail message when saving or not. Default value is true.

Returns: boolean

getRenderedContactFields()

public final int getRenderedContactFields()

Defines groups of Contact fields which will be included in output mhtml. Default value is ContactFieldsSet.AllExisting.

Returns: int

getRenderingHeaders()

public final List<String> getRenderingHeaders()

Gets list of headers for rendering.

Returns: java.util.List<java.lang.String>

getSaveAllHeaders()

public final boolean getSaveAllHeaders()

Defines whether need to save all headers in output mhtml or not. Default value is false.

Returns: boolean

getSaveAttachments()

public final boolean getSaveAttachments()

Gets or sets a value indicating whether to save attachments.

Value: true if attachments should be saved; otherwise, false .

Returns: boolean

getSavedHeaders()

public final List<String> getSavedHeaders()

Gets list of headers which will be present in saved mhtml content. Default value is empty list.

Returns: java.util.List<java.lang.String>

getSkipInlineImages()

public final boolean getSkipInlineImages()

Defines whether skip references on images at saving in mhtml or not. Default value is false.

Returns: boolean

getTimeout()

public final int getTimeout()

Limits the time in milliseconds of formatting message while saving in Mht. Default value 3 sec.

Returns: int

getTimeoutReachedHandler()

public final TimeoutReachedHandler getTimeoutReachedHandler()

Raised if timed out while saving to Mhtml.

Returns: TimeoutReachedHandler

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setAfterHeadersFormat(String value)

public final void setAfterHeadersFormat(String value)

After headers format.

Value: The styles to be injected into resulting html body.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setBeforeHeadersFormat(String value)

public final void setBeforeHeadersFormat(String value)

Before headers format.

Value: The styles to be injected into resulting html body.

Parameters:

ParameterTypeDescription
valuejava.lang.String

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)) properties will be changed to default System.Text.Encoding.UTF8 (java.nio.charset.Charset#getUTF8.getUTF8).

Parameters:

ParameterTypeDescription
valueboolean

setCssStyles(String value)

public final void setCssStyles(String value)

Gets or sets the additional css styles for the formatter.

Value: The styles to be injected into resulting html body.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setCustomProgressHandler(ConversionProgressEventHandler value)

public final void setCustomProgressHandler(ConversionProgressEventHandler value)

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

Parameters:

ParameterTypeDescription
valueConversionProgressEventHandler

setDefaultHeaderFormat(String value)

public final void setDefaultHeaderFormat(String value)

Default header line format.

Value: The styles to be injected into resulting html body.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setDefaultPageHeaderFormat(String value)

public final void setDefaultPageHeaderFormat(String value)

Default page header format.

Value: The styles to be injected into resulting html body.

Parameters:

ParameterTypeDescription
valuejava.lang.String

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

setMhtFormatOptions(int value)

public final void setMhtFormatOptions(int value)

Defines additional options when saving in MHTML format. Default value is MhtFormatOptions.WriteHeader | MhtFormatOptions.WriteOutlineAttachments.

Parameters:

ParameterTypeDescription
valueint

setPreserveOriginalBoundaries(boolean value)

public final void setPreserveOriginalBoundaries(boolean value)

Defines whether need keep original boundaries in mail message when saving or not.

Parameters:

ParameterTypeDescription
valueboolean

setPreserveOriginalDate(boolean value)

public final void setPreserveOriginalDate(boolean value)

Defines whether need keep original date in mail message when saving or not. Default value is true.

Parameters:

ParameterTypeDescription
valueboolean

setRenderedContactFields(int value)

public final void setRenderedContactFields(int value)

Defines groups of Contact fields which will be included in output mhtml. Default value is ContactFieldsSet.AllExisting.

Parameters:

ParameterTypeDescription
valueint

setSaveAllHeaders(boolean value)

public final void setSaveAllHeaders(boolean value)

Defines whether need to save all headers in output mhtml or not. Default value is false.

Parameters:

ParameterTypeDescription
valueboolean

setSaveAttachments(boolean value)

public final void setSaveAttachments(boolean value)

Gets or sets a value indicating whether to save attachments.

Value: true if attachments should be saved; otherwise, false .

Parameters:

ParameterTypeDescription
valueboolean

setSkipInlineImages(boolean value)

public final void setSkipInlineImages(boolean value)

Defines whether skip references on images at saving in mhtml or not. Default value is false.

Parameters:

ParameterTypeDescription
valueboolean

setTimeout(int value)

public final void setTimeout(int value)

Limits the time in milliseconds of formatting message while saving in Mht. Default value 3 sec.

Parameters:

ParameterTypeDescription
valueint

setTimeoutReachedHandler(TimeoutReachedHandler value)

public final void setTimeoutReachedHandler(TimeoutReachedHandler value)

Raised if timed out while saving to Mhtml.

Parameters:

ParameterTypeDescription
valueTimeoutReachedHandler

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