Browse our Products

Aspose.Email for .NET 24.9 Release Notes

All Changes

KeySummaryCategory
EMAILNET-41163Implement the ability to add headers when creating EWSClientFeature
EMAILNET-40852Provide APIs to get the color of message categoryFeature
EMAILNET-41390IMAP Authenticate Plain issue when there are special charactersBug
EMAILNET-41427Japanese base64 encoded email address being corruptedBug
EMAILNET-40689EWSClient.FetchItems throws KeyNotFoundExceptionBug
EMAILNET-41423Issue with MSG to MHT ConversionBug

New Features

Ability to Add Headers When Creating EWSClient

We have introduced the capability to add custom headers when creating an instance of IEWSClient. This feature is particularly useful for scenarios where specific headers are required during client initialization, such as the X-AnchorMailbox header in EWS.

Changes in Public API

  • New overloaded GetEWSClient methods:
    • IEWSClient GetEWSClient(string mailboxUri, ICredentials credentials, WebProxy proxy, Dictionary headers)
    • async Task GetEwsClientAsync(string mailboxUri, ICredentials credentials, WebProxy proxy, CancellationToken cancellationToken , Dictionary headers)

Code Examples

var headers = new Dictionary<string, string>();
headers.Add("X-AnchorMailbox", smtpExampleAddress);
IEWSClient client = EWSClient.GetEWSClient(HttpsExampleCom, new OAuthNetworkCredential("UserName", "Token"), null, headers);

Retrieve Color of Item Category from PST Files

This new feature allows users to retrieve the color associated with categories in PST files. Users can now obtain a list of categories with their respective names and colors and associate them with individual PST items.

Changes in Public API

  • New enum: OutlookCategoryColor
  • New class: PstItemCategory
  • New method in PersonalStorage class: List<PstItemCategory> GetCategories()

Code Examples

Retrieve available categories fronm PST:

using (var pst = PersonalStorage.FromFile("mailbox.pst"))
{
   var categories = pst.GetCategories();
   
   foreach(var category in categories)
   {
       Console.WriteLine(category);
   }
}

Matching a category name with its color:

using (var pst = PersonalStorage.FromFile("mailbox.pst"))
{
    // Get all categories from the PST
    var availableCategories = pst.GetCategories();
    
    // Extract a message from the PST and retrieve the list of category names for the message
    var messageCategoryList = FollowUpManager.GetCategories(pst.ExtractMessage(messageInfo));
    
    // Iterate through each category in the message and match it with the PST category list
    foreach (var messageCategory in messageCategoryList)
    {
        var category = availableCategories.Find(c => c.Name.Equals(messageCategory, StringComparison.OrdinalIgnoreCase));

        if (category != null)
        {
            // Print the category name and its associated color
            Console.WriteLine(category);
        }
        else
        {
            Console.WriteLine($"Category: {messageCategory}, Color: Not found");
        }
    }
}