Free Support Forum - aspose.com

Is there a way to tell the body format of an msg email?

Hi, Is there a way to tell the body format of an msg email? i.e. Text, html, RTF.

Thanks.

Hello, Becky,

Are you talking about the MapiMessage object? After you load the msg file to a MapiMessage object, you can check its properties.

If the MapiMessage.Body is not null, which means the text body is not empty.

If the MapiMessage.BodyRtf is not null, which means the rtf formatted body is not empty.

Thanks


Hi Iret,

I noticed these two properties, but have a BodyRtf not null is not enough to determine if a message is RTF or not, I noticed that even for html emails the BodyRtf is not null.

Thanks,

Becky

For outlook message files, they have rtf formatted body content almost all the time. It looks like Outlook adds the rtf body.

But the html body is not like the rtf. It may or may not have. Therefore, when we convert the Message file into eml or mht, we convert the rtf body into html.

Maybe you check the perperties:

PR_TRANSPORT_MESSAGE_HEADERS = 0x007D001E;

PR_TRANSPORT_MESSAGE_HEADERS_W = 0x007D001F;

If you can provide me some sample message files, I will be glad to check it out.