We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Loading mht emails using MailMesage does not populate the email fields correctly (C# .NET)

Hi,

I’m using the latest version of Aspose.Email for NET(at the time of writing 20.5.0) and when loading any mht file using the MailMessage class the fields are not populated correctly:

  • The body has in the begining of it the header fields (To, From, Subject)
  • The header fields are not populated at all.

This is a blocker as we can’t use it since this is not fixed. So the body will not contain any header related information but the data will be placed in the appropriate fields.

Here is an example mht email, however it will work for any mht email.
mht_example_email.zip (8.9 KB)

This is the code that I’m using to load the email:

image.png (30.9 KB)

Thanks,
Gabriel

@arnoldbeilandevozon,

I have checked the MHT file shared by you. This is not an issue but normal behavior of API. The shared file contains mime part with Content-Type: text/html; and does not contains headers TO, From, CC, Subject. These mime part contains TO, From, CC, Subject headers as html content, so Aspose.Email API interpret this mime part as HtmlBody. You can check this by yourself by any text editor.

Ok, thanks for the information.

@arnoldbeilandevozon,

Thank you for your understanding.