Detect Format
Detects the mail message format from a file extension.
Code
using DRIT.Mail;
// Load with an explicit format
IMailMessage mail = MailFile.Load("message.dat", MailMessageFormat.Eml);
// Inspect the source format of a loaded message
Console.WriteLine($"Source format: {mail.SourceFormat}");
// The MailMessageFormat enumeration values:
// Msg - Outlook Item (.msg)
// Pst - Outlook Personal Folders (.pst)
// Eml - Internet email message (.eml)
// ICal - iCalendar (.ics)
// VCard - vCard (.vcf)
// Mbox - MBOX mailbox archive
// Html - HTML (.html)
Remarks
Use MailFile.Load(string fileName, MailMessageFormat format) when the file
extension does not match the actual format, or when loading from a stream where
the extension is not available.