Browse our Products

Aspose.Email for .NET 25.6 Release Notes

All Changes

KeySummaryCategory
EMAILNET-41584Implement a method for enumerating twice-deleted messages from PSTEnhancement
EMAILNET-41558Pagination in FolderInfo.getContents(MailQuery query… does not work correctlyEnhancement
EMAILNET-41589Add the ability to set encoding in the meta tag when saving in html and mhtmlEnhancement
EMAILNET-41590Extract embedded images as resources when loading from htmlBug
EMAILNET-41588IPM.Contact item,load and save as html - get corrupted outputBug
EMAILNET-41587IPM.Sharing extra charactersBug
EMAILNET-41581MBOX to TiFF Text Render IssueBug
EMAILNET-41544MSG to EML: Missing filename in Content-Disposition for some attachmentsBug

New Enhancements

Enumerate Soft-Deleted Messages from PST

We’ve added support for enumerating messages that have been deleted twice (soft-deleted) in PST files.

New Method:

  • PersonalStorage.FindAndEnumerateSoftDeletedItems() Returns an enumerable collection of RestoredItemEntry objects, each containing a deleted MapiMessage and its corresponding FolderId.

Usage Example:

// Load the PST file
using (var pst = PersonalStorage.FromFile(fileName))
{
    // Enumerate soft-deleted items
    foreach (var entry in pst.FindAndEnumerateSoftDeletedItems())
    {
        var message = entry.Item;
        var folderId = entry.FolderId;

        Console.WriteLine($"Subject: {message.Subject}");
        Console.WriteLine($"Deleted from Folder ID: {folderId}");
        Console.WriteLine("-----------------------------------");
    }
}

The RestoredItemEntry class includes the following properties:

  • MapiMessage Item — The recovered message.
  • string FolderId — The identifier of the folder the message originally belonged to.

Pagination Support in FolderInfo.GetContents

You can now retrieve folder contents in a paginated manner using a new overload of the GetContents method. This makes it easier to process large PST folders efficiently.

New Method:

  • FolderInfo.GetContents(MailQuery query, int startIndex, int count) Retrieves a subset of messages that match the specified query, starting from a given index and limited by a count.

Usage Example:

// Load the PST file
using (var pst = PersonalStorage.FromFile(fileName))
{
    // Access a specific subfolder
    var folder = pst.RootFolder.GetSubFolder("Inbox");

    // Build a query to filter messages by sender address
    var queryBuilder = new PersonalStorageQueryBuilder();
    queryBuilder.From.Contains("report-service", true);

    // Define the page size
    int pageSize = 5;

    // Retrieve and process messages in pages
    for (int pageIndex = 0; pageIndex < 6; pageIndex++)
    {
        int startIndex = pageIndex * pageSize;

        // Get a page of messages
        var messages = folder.GetContents(queryBuilder.GetQuery(), startIndex, pageSize);

        foreach (MessageInfo messageInfo in messages)
        {
            // Output basic info about each message
            Console.WriteLine($"Subject: {messageInfo.Subject}, Sender: {messageInfo.SenderRepresentativeName}");
        }
    }
}

This enhancement improves performance and control when navigating large folders.