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

Enumerate Messages

Enumerates the messages in a PST folder.

Code

using DRIT.Mail.Pst.PhysicalLayout;

using var pst = new PstFile("archive.pst");

foreach (var folder in pst.Folders.GetAllFoldersFlatDepthFirst())
{
    Console.WriteLine($"Folder: {folder.Name}");

    foreach (var message in folder.GetMapiMessages())
    {
        Console.WriteLine($"  {message.Subject}");
    }
}

Remarks

Folder.GetMapiMessages() returns the messages stored in the folder as MapiMessage instances. Each message is materialized on demand from the PST NDB layer.

  • Improve this Doc
Back to top

DR-IT Software documentation

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

Generated by DocFX