Browse our Products

Aspose.Email for .NET 21.8 Release Notes

All Changes

EMAILNET-40359When converting MSG to PDF atendees are missingBug
EMAILNET-40346NullPointerException is thrown when adding MSG files to PST fileBug
EMAILNET-40348ImapClient contructor throws ArgumentNullException for single file appBug
EMAILNET-40265SmtpClient.Send throws OperationCancelledExceptionBug
EMAILNET-40300Problem using SMTP bulk email in NUnit test frameworkEnhancement
EMAILNET-40333Filter messages containing attachments through ImapClientFeature
EMAILNET-40205PST traversal API implementationFeature

New Features

PST file traversal API

The traversal API allows extracting all PST 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 PersonalStorage(TraversalExceptionsCallback callback) constructor and Load(string fileName) method instead of FromFile method.

The constructor allows defining a callback method.

using (var currentPst = new PersonalStorage((exception, itemId) => { /* 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 (currentPst.Load(inputStream))

Code example

using (PersonalStorage pst = new PersonalStorage((exception, itemId) => { /* Exception handling  code. */ }))
    if (pst.Load(@"test.pst"))
		GetAllMessages(pst, pst.RootFolder);

private static void GetAllMessages(PersonalStorage pst, FolderInfo folder)
    foreach (var messageEntryId in folder.EnumerateMessagesEntryId())
        MapiMessage message = pst.ExtractMessage(messageEntryId);
    foreach (FolderInfo subFolder in folder.GetSubFolders())
        GetAllMessages(pst, subFolder);

Custom search by message fields with ImapClient

Gmail has an IMAP Extension that implements the search:

AE_1_1_0034 SEARCH X-GM-RAW "has:attachment"
* SEARCH 1 3 5 7 9
AE_1_1_0034 OK SEARCH completed (Success)

The CustomSearch method has been added to ImapQueryBuilder.

ImapQueryBuilder builder = new ImapQueryBuilder();
builder.CustomSearch("X-GM-RAW \"has:attachment\"");
MailQuery query = builder.GetQuery();
messageInfoCol = client.ListMessages(query);