Browse our Products

Aspose.Email for .NET 21.12 Release Notes

All Changes

KeySummaryCategory
EMAILNET-40230Zimbra calendars backup to PSTFeature
EMAILNET-40267Ability to skip exceptions while enumerating messages from OLM fileFeature
EMAILNET-40481Contacts API is being deprecated. Migrate to People API to retain programmatic access to Google ContactsEnhancement

New Features

OLM file traversal API

The traversal API allows extracting all items as far as possible, without throwing out exceptions, even if some data of the original file is corrupted.

The following steps show how to use this API.

Use OlmStorage(TraversalExceptionsCallback callback) constructor and Load(string fileName) method instead of FromFile method.

The constructor allows defining a callback method.

using (var olm = new OlmStorage((exception, id) => { /* Exception handling  code. */ }))

Loading and traversal exceptions will be available through the callback method.

The Load method returns 'true' if the file has been loaded successfully and further traversal is possible. If a file is corrupted and no traversal is possible, 'false' is returned.

if (olm.Load(fileName))

Code example

using (var olm = new OlmStorage((exception, id) => { /* Exception handling  code. */ }))
{
    if (olm.Load(fileName))
    {
        var folderHierarchy = olm.GetFolders();
        ExtractItems(olm, folderHierarchy);
    }
}

private static void ExtractItems(OlmStorage olm, List<OlmFolder> folders)
{
    foreach (var folder in folders)
    {
        if (folder.HasMessages)
        {
            Console.WriteLine(folder);

            foreach (var msg in olm.EnumerateMessages(folder))
            {
                Console.WriteLine(msg.Subject);
            }
        }

        if (folder.SubFolders.Count > 0)
        {
            ExtractItems(olm, folder.SubFolders);
        }
    }
}

Export calendar and contact items from Zimbra backup files

We have implemented the export of Zimbra’s calendar and contacts to iCalendar and VCard formats.

Code example

using (var reader = new TgzReader(@"test2.tgz"))
{
    //contacts files can be found in Contacts and Emailed Contacts subfolders
    //calendar files can be found in Calendar subfolder
    reader.ExportTo(@"out");
}