Browse our Products

Aspose.Email for Java 24.9 Release Notes

All Changes

KeySummaryCategory
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-41423Issue with MSG to MHT ConversionBug
EMAILJAVA-35314Missing space from HTML Body textBug

New Features

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:

try (PersonalStorage pst = PersonalStorage.fromFile("mailbox.pst")) {
    List<PstItemCategory> categories = pst.getCategories();

    for (PstItemCategory category : categories) {
        System.out.println(category);
    }
}

Matching a category name with its color:

try (PersonalStorage pst = PersonalStorage.fromFile("mailbox.pst")) {
    // Get all categories from the PST
    List<PstItemCategory> availableCategories = pst.getCategories();

    // Extract a message from the PST and retrieve the list of category names for the message
    Iterable<?> messageCategoryList = FollowUpManager.getCategories(pst.extractMessage(messageInfo));

    // Iterate through each category in the message and match it with the PST category list
    for (Object messageCategory : messageCategoryList) {
        PstItemCategory category = null;
        for (PstItemCategory c : availableCategories) {
            if (c.getName().equalsIgnoreCase(messageCategory.toString())) {
                category = c;
                break;
            }
        }

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