Message from PST file is not reading the Body content

I have a PST file both with HTML body content. I have verified this in Outlook and see the HTML formatting. Additionally, I have used Outlook Spy to view the MAPI properties and the HTML body property is set as expected.

When reading the message with Aspose.Email.Storage.Pst the BodyType shows up as PlainText, and the Body property is null, the BodyHTML is an empty string, and the BodyRTF is null. The type should be Html, and the BodyHtml should be set.

Here is my code:
var _personalStorage = PersonalStorage.FromFile(pstFilePath);
var inboxFolder = _personalStorage.RootFolder.GetSubFolder(“Inbox”);
var item = inboxFolder.EnumerateMessages().ToList()[1];
var msg = MapiMessage.FromProperties(item.Properties);

@NickVirtru,

Please share your sample PST file with us for further investigation at our end.

@kashif.iqbal,

The forum won’t let new users post links or upload files. Are you able to turn off that limitation for my account temporarily?

@NickVirtru,

Please try again as your permissions have been updated.

@kashif.iqbal,

You can download the zip of the PST here Test.zip - Google Drive

There should be two html based emails in the Inbox folder.

  • The first email is a draft that I created with html
  • The second is an email I received in another account and placed into this PST’s Inbox folder.

@NickVirtru,

In order to get the information about these properties, you need to extract the complete message from PST. MapiMessage.FromProperties won’t work in this case. Please let us know if we can be of any additional help to you in this regard.

@kashif.iqbal

Thank you, I see what I have to do now:

_personalStorage.ExtractMessage(item.EntryId);

@NickVirtru,

You are right. You have to extract the message using ExtractMessage method for getting this information. Please let us know if we can be of any additional help to you in this regard.