MailMessage Headers

Hi,

I load an MSG file (or directly from stream via drag&drop event) with MailMessage class and get not all message headers.

Here are the message headers in Outlook:
---------------------------------------------------------
Content-Type: application/ms-tnef; name="winmail.dat"
Content-Transfer-Encoding: binary
From: …
To: …
Date: …
Subject: …
Thread-Topic: …
Thread-Index: AQHMqdSdmdJQXrlsjESDSmceOTp7Kw==
Message-ID: …
Accept-Language: de-DE
Content-Language: de-DE
X-MS-Has-Attach:
X-MS-Exchange-Organization-SCL: -1
X-MS-TNEF-Correlator: …
MIME-Version: 1.0

And I get some other:
-----------------------------------------------------------------------

From: …

To: …
Cc: …
Bcc: …

Date: …

Subject: …
Message-ID: …
Reply-To: …

I use it this way: MailMessage.Load(filename, MessageFormat.Msg)
I need to get at least the Thread-Index header, any ideas?

Hi,


Thank you for your inquiry.

We recommend to use MapiMessage class when input message type is of Outlook format. Please load your message in MapiMessage instance and then compare the Header values with the ones in Outlook.

Please check the below source code for your reference,

C#
var message = Aspose.Email.Outlook.MapiMessage.FromFile(“message.msg”);
var headers = message.Headers;

You can also load the MailMessage into an instance of MapiMessage by using the static method MapiMessage .FromMailMessage().

Please feel free to write back.
Regards,

Hi,

thank you, the MapiMessage class can read all headers correctly.