Browse our Products

Aspose.Email for Java 24.5 Release Notes

All Changes

EMAILNET-41346Get message recipients from PST by entry idFeature
EMAILNET-41316Recovery of soft deleted items in local PST and OST filesFeature
EMAILNET-41341Convert multi contact Vcf to MapiDistributionListFeature
EMAILNET-41342Wrong sent date saved while saving the message as .msg from mboxEnhancement
EMAILNET-41252InvalidCastException trying to replace an attachment’s ContentStreamBug
EMAILNET-41310Not able to read events from ICS fileBug
EMAILNET-41339Cannot create a calendar item in a non-calendar folderBug

New Features

Extract Message Recipients from PST

A feature has been introduced that allows recipients to be extracted from PST files using a message entry ID. This feature is available in the PersonalStorage class.

Recipients Extracted by Entry ID:

Method: MapiRecipientCollection extractRecipients(String entryId)

Code example:

try (PersonalStorage pst = PersonalStorage.fromFile(fileName)) {  
    // Recipients are extracted using the entry ID
    MapiRecipientCollection recipients = pst.extractRecipients("AAAAADzSMygQQFJOkKwVhb8v5EUkASAA");

Recipients Extracted from Message Info:

Method: MapiRecipientCollection extractRecipients(MessageInfo messageInfo)

Code example:

try (PersonalStorage pst = PersonalStorage.fromFile(fileName)) {  
    // The "Inbox" folder is obtained
    FolderInfo folder = pst.getRootFolder().getSubFolder("Inbox");

    // Each message in the "Inbox" folder is iterated
    for (MessageInfo messageInfo : folder.enumerateMessages()) {
        // Recipients are extracted from each message
        MapiRecipientCollection recipients = pst.extractRecipients(messageInfo);

2. Soft Deleted Items Recovered in Local PST and OST Files

A method to recover soft deleted items from local PST and OST files has been provided. This is implemented via the PersonalStorage class.

Method: Iterable<RestoredItemEntry> findAndExtractSoftDeletedItems()

Code example:

try (PersonalStorage pst = PersonalStorage.fromFile(fileName)) {
    // Soft deleted items are found and extracted
    IGenericList<RestoredItemEntry> entries = pst.findAndExtractSoftDeletedItems();

    // The recovered items are iterated through
    for (int index = 0; index < entries.size(); index++) {
        // Folder information is obtained by ID
        FolderInfo folderInfo = pst.getFolderById(entries.get_Item(index).getFolderId());

        // A directory for the folder is created if it doesn't exist
        File folder = new File(new File(path), folderInfo.getDisplayName());
        if (!folder.exists()) {

        // The restored item is obtained
        MapiMessage msg = entries.get_Item(index).getItem();

        // The restored item is saved as a .msg file File(folder, index + ".msg").getPath());

3. Multi-Contact VCF Converted to MapiDistributionList

Support has been added for converting multi-contact VCF files into MapiDistributionList objects. This can be done using the following static methods in the MapiDistributionList class.


  • static MapiDistributionList fromVCF(String filePath)
  • static MapiDistributionList fromVCF(InputStream stream)

Code example:

// A multi-contact VCF file is converted to a MapiDistributionList
MapiDistributionList dlist = MapiDistributionList.fromVCF(fileName);