Aspose.Email for .NET 24.5 (DLLs-only package) brings exciting new features and enhancements to take your email processing applications to the next level. This update focuses on improved functionality for working with PST files within your C# email processing apps.
This update to the C# email API enables easy retrieval of recipients associated with messages within PST files using entry IDs or message information.
Please check out the following code example, which showcases the extraction of recipients with an entry ID using the MapiRecipientCollection ExtractRecipients(string entryId)
method.
using (var pst = PersonalStorage.FromFile(fileName))
{
// Recipients are extracted using the entry ID
var recipients = pst.ExtractRecipients("AAAAADzSMygQQFJOkKwVhb8v5EUkASAA");
}
Source*
This code sample illustrates how to extract recipients from message info using the MapiRecipientCollection ExtractRecipients(MessageInfo messageInfo)
method.
using (var pst = PersonalStorage.FromFile(fileName))
{
// The "Inbox" folder is obtained
var folder = pst.RootFolder.GetSubfolder("Inbox");
// Each message in the "Inbox" folder is iterated
foreach (var messageInfo in folder.EnumerateMessages())
{
// Recipients are extracted from each message
var recipients = pst.ExtractRecipients(messageInfo);
}
}
Source*
Recover Soft Deleted Items in Local PST and OST Files
.NET developers can now restore accidentally deleted emails and other items from local PST and OST archives. This code example highlights the recovery of soft deleted items using the IList<RestoredItemEntry> FindAndExtractSoftDeletedItems()
method.
using (var pst = PersonalStorage.FromFile(fileName))
{
// Soft deleted items are found and extracted
var entries = pst.FindAndExtractSoftDeletedItems();
// The recovered items are iterated through
for (var index = 0; index < entries.Count; index++)
{
// Folder information is obtained by ID
var folderInfo = pst.GetFolderById(entries[index].FolderId);
// A directory for the folder is created if it doesn't exist
if (!Directory.Exists(folderInfo.DisplayName))
{
Directory.CreateDirectory(Path.Combine(path, folderInfo.DisplayName));
}
// The restored item is obtained
var msg = entries[index].Item;
// The restored item is saved as a .msg file
msg.Save(Path.Combine(path, folderInfo.DisplayName, $"{index}.msg"));
}
}
Source*
Aspose.Email for .NET 24.5 allows effortless conversion of VCF files containing multiple contacts into MapiDistributionList
objects for efficient email list management.
Bug Fixes
- Addressed
InvalidCastException
when replacing attachment’s ContentStream
(EMAILNET-41252). - Resolved issues with reading events from ICS files (EMAILNET-41310).
- Fixed incorrect sent date saving while converting messages to .MSG format (EMAILNET-41342).
- Improved calendar item creation functionality within non-calendar folders (EMAILNET-41339).
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting Aspose.Email for .NET 24.5 Release Notes.