Browse our Products

Aspose.Email for CPP 20.10 Release Notes

Aspose.Email for C++ 20.10 is based on Aspose.Email for .NET 20.10.

New Features

Reading Corrupted PST/OST Files

Sometimes it may not be possible to read the PST/OST due to some issues. For example, some data blocks may be corrupted. In such cases, exceptions usually arise when calling the EnumerateFolders, EnumerateMessages, GetContents, GetSubfolders, etc. methods. But individual messages or folders may remain undamaged in the storage.

We have added methods that allow to find item identifiers in a hierarchical manner. Further, you can extract items by identifiers.

// finds the identifiers of messages for for the folder.
System::SharedPtr<System::Collections::Generic::IList<System::String>> PersonalStorage::FindMessages(System::String parentEntryId);
// finds the identifiers of subfolders for for folder.
System::SharedPtr<System::Collections::Generic::IList<System::String>> PersonalStorage::FindSubfolders(System::String parentEntryId);

Find more details in Aspose.Email for C++ documentation.

It should be noted that despite its advantages, there are corrupted storages that cannot be read even using these methods.

Code sample:

void ExploreCorruptedPst(System::SharedPtr<Aspose::Email::Storage::Pst::PersonalStorage> pst, System::String rootFolderId)
{
   auto messageIdList = pst->FindMessages(rootFolderId);
   for (auto messageId : System::IterateOver(messageIdList))
   {
       try
       {
           auto msg = pst->ExtractMessage(messageId);
            System::Console::WriteLine(System::String(u"- ") + msg->get_Subject());
       }
       catch (...)
       {
            System::Console::WriteLine(System::String(u"Message reading error. Entry id: ") + messageId);
       }
   }
   auto folderIdList = pst->FindSubfolders(rootFolderId);
   for (auto subFolderId : System::IterateOver(folderIdList))
   {
       if (subFolderId != rootFolderId)
       {
           try
           {
                System::SharedPtr<FolderInfo> subfolder = pst->GetFolderById(subFolderId);
                System::Console::WriteLine(subfolder->get_DisplayName());
           }
           catch (...)
           {
                System::Console::WriteLine(System::String(u"Message reading error. Entry id: ") + subFolderId);
           }
           ExploreCorruptedPst(pst, subFolderId);
      }
   }
}

void ProcessCorruptedPst(System::String fileName)
{
    auto pst = PersonalStorage::FromFile(fileName);
    ExploreCorruptedPst(pst, pst->get_RootFolder()->get_EntryIdString());
}

The full code of the example can be found at Aspose Email for C++ GitHub examples repository

Windows 32 Bit Libraries Included in the Release

This release comes with 32-bit (x86 platform) Windows libraries as well as 64 bit (x64 platform)