Browse our Products

Aspose.Email for .NET 26.7 Release Notes

All Changes

KeySummaryCategory
EMAILNET-41804MapiMessage.Recipients.Add - EX address validation too strictEnhancement
EMAILNET-41805MapiRecipientCollection.Add(…) – return newly created instanceEnhancement
EMAILNET-41792ArgumentException in MapiMessage.SaveAsTnef when saving EML with TNEFBug
EMAILNET-41797Support IdentificationInfo.Anniversary date field in VcardContact and apply it in vcf 4.0Bug
EMAILNET-41796Avoid duplicate X-VCARD-PRODID header when saving contact in version 3 and 4Bug
EMAILNET-41790Binary libraries detected as MhtBug
EMAILNET-41791ArgumentNullException (parameter name: address) in 26.5 version at sending MailMessage via Graph client.Bug

New Features

Add Methods Now Return the Newly Created Instance

The Add methods for both recipients and attachments have been updated to return the object they create, allowing immediate access to the new item without a separate lookup. This streamlines code that needs to configure the newly added recipient or attachment right after insertion.

Public API Changes:

  • MapiAttachmentCollection.Add(string name, MapiMessage msg) – Returns newly created attachment
  • MapiAttachmentCollection.Add(string name, byte[] data) – Returns newly created attachment
  • MapiAttachmentCollection.Add(string name, ReferenceAttachmentOptions options) – Returns newly created attachment
  • MapiRecipientCollection.Add(string address, string displayName, MapiRecipientType recipientType) – Returns newly created recipient
  • MapiRecipientCollection.Add(string address, string addressType, string displayName, MapiRecipientType recipientType) – Returns newly created recipient

Code Example:

var message = new MapiMessage();
var recipient = message.Recipients.Add("alice.johnson@example.com", "SMTP", "Alice Johnson", MapiRecipientType.MAPI_TO);
recipient.DisplayName = "Alice Johnson";
var attachment = message.Attachments.Add("invoice.pdf", File.ReadAllBytes("invoice.pdf"));
attachment.DisplayName = "Invoice #2026-001.pdf";