MailMessage.Save
Contents
[
Hide
]Save(string)
Saves the message to a file in EML format, whatever the file extension.
public virtual void Save(string fileName)
| Parameter | Type | Description |
|---|---|---|
| fileName | String | The path of the file to write. |
See Also
- class MailMessage
- namespace Aspose.Email
- assembly Aspose.Email
Save(string, SaveOptions)
Saves the message to a file in the format selected by the options.
public virtual void Save(string fileName, SaveOptions options)
| Parameter | Type | Description |
|---|---|---|
| fileName | String | The path of the file to write. |
| options | SaveOptions | The options; their class selects the format, such as MsgSaveOptions or MhtSaveOptions. |
Examples
The following example shows how to save an email message as HTML with embedded images.
[C#]
var fileName = "EmailWithAttachEmbedded.eml";
var eml = MailMessage.Load(fileName);
var options = new HtmlSaveOptions()
{
ResourceRenderingMode = ResourceRenderingMode.EmbedIntoHtml
};
eml.Save($"{fileName}.html", options);
[Visual Basic]
Dim fileName = "EmailWithAttachEmbedded.eml"
Dim eml = MailMessage.Load(fileName)
Dim options = New HtmlSaveOptions() With {
.ResourceRenderingMode = ResourceRenderingMode.EmbedIntoHtml
}
eml.Save($"{fileName}.html", options)
See Also
- class SaveOptions
- class MailMessage
- namespace Aspose.Email
- assembly Aspose.Email
Save(Stream, SaveOptions)
Saves the message to a stream in the format selected by the options.
public virtual void Save(Stream stream, SaveOptions options)
| Parameter | Type | Description |
|---|---|---|
| stream | Stream | The stream to write to. |
| options | SaveOptions | The options; their class selects the format, such as MsgSaveOptions or MhtSaveOptions. |
See Also
- class SaveOptions
- class MailMessage
- namespace Aspose.Email
- assembly Aspose.Email
Save(Stream)
Saves the message to a stream in EML format.
public virtual void Save(Stream stream)
| Parameter | Type | Description |
|---|---|---|
| stream | Stream | The stream to write to. |
See Also
- class MailMessage
- namespace Aspose.Email
- assembly Aspose.Email