Browse our Products

Aspose.Email for Java 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
EMAILJAVA-35487NullReferenceException in fromMailMessage when loading MAPI MSG file — regression since 26.5Bug

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:

MapiMessage message = new MapiMessage();
MapiRecipient recipient = message.getRecipients().add("alice.johnson@example.com", "SMTP", "Alice Johnson", MapiRecipientType.MAPI_TO);
recipient.setDisplayName("Alice Johnson");
MapiAttachment attachment = message.getAttachments().add("invoice.pdf", readAllBytes("invoice.pdf"));
attachment.setDisplayName("Invoice #2026-001.pdf");