Class EmlSaveOptions
Contents
[
Hide
]EmlSaveOptions class
Provides options for controlling how MailMessage instances are saved to EML and EMLX format. This class allows you to customize the saving behavior for features such as embedded message format preservation, TNEF handling, signed message integrity, and boundary template configuration.
public class EmlSaveOptions : SaveOptions
Constructors
| Name | Description |
|---|---|
| EmlSaveOptions(MailMessageSaveType) | Initializes a new instance of the EmlSaveOptions class for the specified format. |
Properties
| Name | Description |
|---|---|
| BoundariesTemplate { get; set; } | Gets or sets the template for the MIME boundaries of the message; null (the default) uses generated boundaries. |
| CheckBodyContentEncoding { get; set; } | Gets or sets a value indicating whether the encoding of the HTML body is checked before saving. The default is false. |
| CustomProgressHandler { get; set; } | Gets or sets a handler that is called as the saving progresses. |
| FileCompatibilityMode { get; set; } | Gets or sets conversions applied while saving, such as encoding the TNEF attachment again. The default is FileCompatibilityMode.None. |
| MailMessageSaveType { get; set; } | Gets or sets the format the options save to. |
| PreserveEmbeddedMessageFormat { get; set; } | Gets or sets a value indicating whether embedded messages keep their original format (MSG) instead of being converted to EML. The default is false. |
| PreserveSignedContent { get; set; } | Gets or sets a value indicating whether a signed message is saved exactly as it was loaded, so that its signature stays valid. The default is false. |
Remarks
Use this class with Save to specify custom save options. Inherits from SaveOptions and adds EML/EMLX-specific configuration through properties like PreserveEmbeddedMessageFormat, PreserveSignedContent, and BoundariesTemplate.
Examples
The following example shows how to load and Save an EML message Preserving the embedded message format.
[C#]
MailMessage mailMessage = MailMessage.Load("source.eml");
// Save as eml with preserved embedded message format
EmlSaveOptions emlSaveOptions = new EmlSaveOptions(MailMessageSaveType.EmlFormat)
{
PreserveEmbeddedMessageFormat = true
};
mailMessage.Save("target.eml", emlSaveOptions);
[Visual Basic]
Dim mailMessage As MailMessage = MailMessage.Load("source.eml")
' Save as eml with preserved embedded message format
Dim emlSaveOptions As EmlSaveOptions = New EmlSaveOptions(MailMessageSaveType.EmlFormat) With {
.PreserveEmbeddedMessageFormat = True
}
}
mailMessage.Save("target.eml", emlSaveOptions)
See Also
- class SaveOptions
- namespace Aspose.Email
- assembly Aspose.Email