Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save documentprocessing/c6c14df19adc9e7e3778e6b29c03f35a to your computer and use it in GitHub Desktop.
Save documentprocessing/c6c14df19adc9e7e3778e6b29c03f35a to your computer and use it in GitHub Desktop.
Read Outlook MSG properties using MSGReader API
using (var msg = new MsgReader.Outlook.Storage.Message("testfile.msg"))
{
var from = msg.Sender;
var sentOn = msg.SentOn;
var recipientsTo = msg.GetEmailRecipients(MsgReader.Outlook.RecipientType.To, false, false);
var recipientsCc = msg.GetEmailRecipients(MsgReader.Outlook.RecipientType.Cc, false, false);
var subject = msg.Subject;
var htmlBody = msg.BodyHtml;
// etc...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment