Load Message
Loads a mail message from a file, auto-detecting the format from the file extension.
Code
using DRIT.Mail;
// Load a mail message (format auto-detected from the file extension)
IMailMessage mail = MailFile.Load("message.msg");
// Access the underlying MAPI message
MapiMessage mapi = mail.MapiMessage;
Console.WriteLine($"Subject: {mapi.Subject}");
Console.WriteLine($"Sender: {mapi.SenderName}");
Console.WriteLine($"Source format: {mail.SourceFormat}");
Remarks
The MailFile.Load(string fileName) overload inspects the file extension and
selects the appropriate parser. Supported extensions include .msg, .eml,
.pst, .mbox, .ics, .vcf, and .html.