Read Mbox(rd)

Hello,
Please kindly direct me to a sample to read all messages inside a Mbox(rd) storage?

@australian.dev.nerds

Please use the following code example to read the Mbox. Hope this helps you.

string filePathMbox = MyDir + "input.mbox";
using (var mbox = new Aspose.Email.Storage.Mbox.MboxrdStorageReader(filePathMbox, false))
{
    int count = mbox.GetTotalItemsCount();
    for (int i = 0; i < count; i++)
    {
        Console.WriteLine("File_Unpack_MboxFile: Debug GetTotalItemsCount = " + mbox.GetTotalItemsCount());
        using (var message = mbox.ReadNextMessage())
        {
            string fileName = "Message " + i + ".eml";
            string filePath = Path.Combine(@"C:\Users\out\", fileName);
            message.Save(filePath, Aspose.Email.SaveOptions.DefaultEml);
        }
    }
}