Class EmlSaveOptions

EmlSaveOptions class

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

public class EmlSaveOptions : SaveOptions

Constructors

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

Properties

NameDescription
CheckBodyContentEncoding { get; set; }Defines whether need check message body content encoding when saving. By default the value is false.
CustomProgressHandler { get; set; }Represents method that usually supplied by calling side and handles progress events.
FileCompatibilityMode { get; set; }Defines inner conversions,that are necessarily to be done when saving a message. The default value is FileCompatibilityMode.None.
MailMessageSaveType { get; set; }Represents the mail message save type.It can be in eml,msg(ASCII or Unicode),mhtml or html format. The default value is Eml.
PreserveEmbeddedMessageFormat { get; set; }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.
PreserveSignedContent { get; set; }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.

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