Check if MapiMessage has RTF body part?

Hi,
What’s the best route to check if MapiMessage has RTF body part?

  1. If MapiMessage.BodyType = BodyContentType.Rtf Then…

  2. If MyMapiMessage.BodyRtf.Length > 0 Then…

  3. etc…?

@australian.dev.nerds

You can use following code example to detect the email body type as RTF. Hope this helps you.

MapiMessage mapiMsg = MapiMessage.Load(MyDir + "input.msg");
Console.WriteLine(mapiMsg.BodyType == BodyContentType.Rtf);
1 Like