In order to read the header a mail item in Outlook, I found the following solution for Outlook 2010 but it does not work with Outlook 2019 (and probably also not with Outlook 365).
var mailItem = item as MailItem;
if (mailItem != null)
{
var header = mailItem.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x007D001E/");
...
Unfortunately I receive this error message:
System.ArgumentException: 'The property "http://schemas.microsoft.com/mapi/proptag/0x007D001E/" cannot be parsed or has an invalid format.'
So, how to read the header of an e-mail using C# and VSTO? What is considered to be best practice?