Free Support Forum - aspose.com

To- From headers printed twice

Hi,

We recently got into a situation where the To, From and other ifnormation is printed twice when converting email to MHTML. Our users are continuously facing this issue when performing the conversion. It didn’t happen earlier and seem to be an issue with last release.

Hi Cornelius,


Thank you for posting your inquiry.

Please try using the MhtFormatOptions to avoid writing the extra header to the output as shown below. Please share your sample file with us if this doesn’t solve your problem.

Code:

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);