Aspose.Email for .NET 5.3 - public API changes (2)

Hello again,

In light of this API changes I’ve reviewed all Aspose.Email-related source code; by searching those types and members, which are marked as obsolete, in order to ensure that there will be no such problems in the near future.

And I’ve found the next:
Aspose.Email.Mail.MailMessage emailMessage = ObtainInstanceFromSomewhere();
MemoryStream memoryStream = new MemoryStream()
emailMessage.Save(memoryStream, MailMessageSaveType.MHtmlFormat, MailMessageSaveOptions.None);

Third line is marked as obsolete: this method overload and the “MailMessageSaveOptions” enumeration is obsolete.
Can you please give me the “modern” equivalent of this combination of parameters, which does the same?

Waiting for your answer. Thanks.

With best regards,
Denis Gvardionov

Hi Denis,

This has been replaced by the MhtFormatOptions class that you can use to specify the MHT save options as shown in the following code sample. I would further request you to please have a look at the code samples available in our documentation section [Managing Email Messages with MailMessage]( for further examples related to MailMessage, specifically the article Converting Email Messages. In case of any further query, please feel free to write to us.


MailMessage eml = MailMessage.Load(Path.Combine(directoryPath, “test.eml”));

// Save as mht with header
MhtSaveOptions mhtSaveOptions = new MhtSaveOptions
MhtFormatOptions = MhtFormatOptions.None

eml.Save(Path.Combine(directoryPath, “outTest.mht”), mhtSaveOptions);