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());
| Constructor and Description |
|---|
MhtSaveOptions()
Initializes a new instance of this class that can be used to save a MailMessage in the Mhtml format.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getCheckBodyContentEncoding()
Defines whether need check message body content encoding when saving.
|
int |
getMhtFormatOptions()
Defines additional options when saving in MHTML format.
|
boolean |
getPreserveOriginalBoundaries()
Defines whether need keep original boundaries in mail message when saving or not.
|
boolean |
getPreserveOriginalDate()
Defines whether need keep original date in mail message when saving or not.
|
boolean |
getSaveAllHeaders()
Defines whether need to save all headers in output mhtml or not.
|
boolean |
getSaveAttachments()
Gets or sets a value indicating whether to save attachments.
|
List<String> |
getSavedHeaders()
Gets list of headers which will be present in saved mhtml content.
|
boolean |
getSkipInlineImages()
Defines whether skip references on images at saving in mhtml or not.
|
int |
getTimeout()
Limits the time in milliseconds of formatting message while saving in Mht.
|
TimeoutReachedHandler |
getTimeoutReachedHandler()
Raised if timed out while saving to Mhtml.
|
void |
setCheckBodyContentEncoding(boolean value)
Defines whether need check message body content encoding when saving.
|
void |
setMhtFormatOptions(int value)
Defines additional options when saving in MHTML format.
|
void |
setPreserveOriginalBoundaries(boolean value)
Defines whether need keep original boundaries in mail message when saving or not.
|
void |
setPreserveOriginalDate(boolean value)
Defines whether need keep original date in mail message when saving or not.
|
void |
setSaveAllHeaders(boolean value)
Defines whether need to save all headers in output mhtml or not.
|
void |
setSaveAttachments(boolean value)
Gets or sets a value indicating whether to save attachments.
|
void |
setSkipInlineImages(boolean value)
Defines whether skip references on images at saving in mhtml or not.
|
void |
setTimeout(int value)
Limits the time in milliseconds of formatting message while saving in Mht.
|
void |
setTimeoutReachedHandler(TimeoutReachedHandler value)
Raised if timed out while saving to Mhtml.
|
getAfterHeadersFormat, getBeforeHeadersFormat, getCssStyles, getDefaultHeaderFormat, getDefaultPageHeaderFormat, getFormatTemplates, getRenderedContactFields, getRenderingHeaders, setAfterHeadersFormat, setBeforeHeadersFormat, setCssStyles, setDefaultHeaderFormat, setDefaultPageHeaderFormat, setRenderedContactFieldscreateSaveOptions, getCustomProgressHandler, getDefaultEml, getDefaultEmlx, getDefaultHtml, getDefaultMhtml, getDefaultMsg, getDefaultMsgUnicode, getDefaultOft, getMailMessageSaveType, setCustomProgressHandler, setMailMessageSaveTypepublic MhtSaveOptions()
Initializes a new instance of this class that can be used to save a MailMessage in the Mhtml format.
public final TimeoutReachedHandler getTimeoutReachedHandler()
Raised if timed out while saving to Mhtml.
public final void setTimeoutReachedHandler(TimeoutReachedHandler value)
Raised if timed out while saving to Mhtml.
public final int getTimeout()
Limits the time in milliseconds of formatting message while saving in Mht. Default value 3 sec.
public final void setTimeout(int value)
Limits the time in milliseconds of formatting message while saving in Mht. Default value 3 sec.
public final int getMhtFormatOptions()
Defines additional options when saving in MHTML format. Default value is MhtFormatOptions.WriteHeader | MhtFormatOptions.WriteOutlineAttachments.
public final void setMhtFormatOptions(int value)
Defines additional options when saving in MHTML format. Default value is MhtFormatOptions.WriteHeader | MhtFormatOptions.WriteOutlineAttachments.
public final boolean getPreserveOriginalBoundaries()
Defines whether need keep original boundaries in mail message when saving or not.
public final void setPreserveOriginalBoundaries(boolean value)
Defines whether need keep original boundaries in mail message when saving or not.
public final boolean getCheckBodyContentEncoding()
Defines whether need check message body content encoding when saving. By default the value is false.
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).
public final void setCheckBodyContentEncoding(boolean value)
Defines whether need check message body content encoding when saving. By default the value is false.
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).
public final boolean getSaveAttachments()
Gets or sets a value indicating whether to save attachments.
Value:true if attachments should be saved; otherwise, false.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.public final boolean getPreserveOriginalDate()
Defines whether need keep original date in mail message when saving or not. Default value is true.
public final void setPreserveOriginalDate(boolean value)
Defines whether need keep original date in mail message when saving or not. Default value is true.
public final boolean getSkipInlineImages()
Defines whether skip references on images at saving in mhtml or not. Default value is false.
public final void setSkipInlineImages(boolean value)
Defines whether skip references on images at saving in mhtml or not. Default value is false.
public final boolean getSaveAllHeaders()
Defines whether need to save all headers in output mhtml or not. Default value is false.
public final void setSaveAllHeaders(boolean value)
Defines whether need to save all headers in output mhtml or not. Default value is false.
Copyright (c) 2008-2024 Aspose Pty Ltd. All Rights Reserved.