Aspose.Email for .NET 22.12 Release Notes

All Changes

EMAILNET-40836Provide APIs to get Get Total Items Count of PersonalStorageFeature
EMAILNET-40697Add aditional folder like Activity, DistList, and RSS to StandardIpmFolderFeature
EMAILNET-40860Add Decrypt method to MapiMessageFeature
EMAILNET-40795Provide APIs to set product IDFeature
EMAILNET-40683How to save a single message from OLM to streamFeature
EMAILNET-40810Add IsInline property in AttachmentEnhancement
EMAILNET-40880IMAP Login password syntax with special charactersEnhancement
EMAILNET-40869Add option to save message headers in mhtmlEnhancement
EMAILNET-40887FileFormatUtil.DetectFileFormat detects the MBOX as MHTBug
EMAILNET-40874Incorrect conversion of message with html table to txtBug
EMAILNET-40877Extra chars in .ics processingBug
EMAILNET-40886Extracting attachment from winmail.dat generates incorrect outputBug
EMAILNET-40873Number of attachments after changing them is doubled in MSGBug
EMAILNET-40859Body issue during EML to PDF conversionBug
EMAILNET-40864CheckBounced returns empty BounceResult propertiesBug
EMAILNET-40875Exception: Invalid cryptographic message typeBug

New Features

Provide method to get Get Total Items Count of PersonalStorage

We have added the GetTotalItemsCount() method to PersonalStorage.Store property. It returns the total number of message items contained in the PST.

Code example:

using (var pst = PersonalStorage.FromFile("my.pst", false))
    var count = pst.Store.GetTotalItemsCount();

Getting and adding a standard RSS Feeds folder in PersonalStorage.

A new RssFeeds value has been added to StandardIpmFolder enum.

The following is a code example to get an RSS Feeds folder.

using (var pst = PersonalStorage.FromFile("my.pst", false))
    var rssFolder = pst.GetPredefinedFolder(StandardIpmFolder.RssFeeds);

And code example to add an RSS Feeds folder.

using (var pst = PersonalStorage.Create("my.pst", FileFormatVersion.Unicode))
    var rssFolder = pst.CreatePredefinedFolder("RSS Feeds", StandardIpmFolder.RssFeeds);

Add Decrypt method to MapiMessage

Changes in public API:

  • MapiMessage.IsEncrypted - Gets a value indicating whether the message is encrypted.
  • MapiMessage.Decrypt() - Decrypts this message(method searches the current user and computer My stores for the appropriate certificate and private key).
  • MapiMessage.Decrypt(X509Certificate2 certificate) - Decrypts this message with certificate.

Code sample:

var privateCert = new X509Certificate2(privateCertFile, "password");
var msg = MapiMessage.Load("encrypted.msg");

if (msg.IsEncrypted);
    var decryptedMsg = msg.Decrypt(privateCert);

Setting a product ID when save MapiCalendar to ICS

We have added ProductIdentifier property to MapiCalendarIcsSaveOptions class. This property specifies the identifier for the product that created the iCalendar object.

Code sample:

var icsSaveOptions = new MapiCalendarIcsSaveOptions
    KeepOriginalDateTimeStamp = true,
    ProductIdentifier = "Foo Ltd"

mapiCalendar.Save("my.ics", icsSaveOptions);

Extract messages from OLM and MBOX by identifiers

Sometimes it is required to extract selected messages by identifiers. For example, your application stores identifiers in a database and extracts a message on demand. This is the efficient way to avoid traversing through the entire storage each time to find a specific message to extract. This feature is now available for OLM and MBOX storages.

New API members in OLM implementation:

  • Added EntryId property to OlmMessageInfo class.
  • Added overloaded ExtractMapiMessage(string id) method to OlmStorage class.

Code example:

foreach (OlmMessageInfo msgInfo in olmFolder.EnumerateMessages())
    MapiMessage msg = storage.ExtractMapiMessage(msgInfo.EntryId);

New API members in MBOX implementation:

  • Added MboxMessageInfo class with the EntryId property.
  • Added EnumerateMessageInfo() method to MboxStorageReader class.
  • Added ExtractMessage(string id) method to MboxStorageReader class.

Code example:

MboxStorageReader reader = MboxStorageReader.CreateReader("my.mbox", new MboxLoadOptions());

foreach (MboxMessageInfo msgInfo in reader.EnumerateMessageInfo())
    MailMessage eml = reader.ExtractMessage(msgInfo.EntryId, new EmlLoadOptions());

Add IsInline property in Attachment

Changes in public API:

  • MapiAttachment.IsInline - Gets a value indicating whether the attachment is inline or regular.

Code samples:

var message = MapiMessage.Load(fileName);

foreach (var attach in message.Attachments)
    Console.WriteLine($"{attach.DisplayName0} : {attach.IsInline)}");