• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

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.

  • Improve this Doc
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX