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

Search MSG

Searches a single MSG file for matching criteria.

Code

using DRIT.Mail;
using DRIT.Mail.Search;

var criteria = new MailSearchCriteria
{
    SubjectContains = "report",
    BodyContains = "quarterly",
};

foreach (IMailMessage match in MailSearcher.Search("message.msg", criteria))
{
    Console.WriteLine($"Subject: {match.MapiMessage.Subject}");
}

Remarks

For a single MSG file, MailSearcher.Search loads the message and applies the criteria. The result is a sequence of zero or one IMailMessage instances.

  • Improve this Doc
Back to top

DR-IT Software documentation

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

Generated by DocFX