Browse our Products

Aspose.Email for Java 24.11 Release Notes

All Changes

KeySummaryCategory
EMAILNET-41465Improve the MapiAttachmentCollection.Add method to add reference attachmentsEnhancement
EMAILNET-41466Add an overloaded versions of FolderInfo.EnumerateMapiMessages method to enhance message search functionalityEnhancement
EMAILNET-41464Create a MapiAttachment property to identify a reference attachmentEnhancement
EMAILNET-41446Iissue when trying to update emails within PST filesBug
EMAILNET-41460TO field parsing in EML fails due to special characterBug
EMAILJAVA-35326Support lazy loading of cloud attachments in Attachment to optimize memory usageEnhancement
EMAILJAVA-35330Saving MailMessage is not deterministicBug
EMAILJAVA-35329Issues when packaging MSG files in PST containersBug

New Features and Enhancements

Improved MapiAttachmentCollection.Add Method to Support Reference Attachments

The MapiAttachmentCollection.add method now includes a new overload to add reference attachments. A new ReferenceAttachmentOptions class has been introduced to define reference attachment properties.

Code Example:

ReferenceAttachmentOptions options = new ReferenceAttachmentOptions(
        "https://drive.google.com/file/d/1HJ-M3F2qq1oRrTZ2GZhUdErJNy2CT3DF/",
        "https://drive.google.com/drive/my-drive",
        "GoogleDrive");

// Add reference attachment
msg.getAttachments().add("Document.pdf", options);

New Property to Identify Reference Attachments

The MapiAttachment class now includes the isReference property, enabling developers to identify reference attachments in a message.

Code Example:

for (MapiAttachment attachment : msg.getAttachments()) {
    if (attachment.isReference()) {
        // Process reference attachment
    }
}

Enhanced FolderInfo.EnumerateMapiMessages Methods

New overloaded methods in the FolderInfo class enhance message search and retrieval capabilities:

  • IGenericEnumerable<MessageInfo> enumerateMessages(MailQuery mailQuery) - Filter messages using a MailQuery.
  • IGenericEnumerable<MessageInfo> enumerateMessages(/*MessageKind*/int kind) - Retrieve messages by type (MessageKind).
  • IGenericEnumerable<MessageInfo> enumerateMessages(int startIndex, int count) - Paginate message retrieval using a starting index and count.

Adding a Streamed Attachment to MapiMessage

In some scenarios, it is necessary to attach files to emails without loading their entire contents into memory at once. This is particularly useful for large attachments or when memory constraints are a concern. The MapiAttachmentCollection.add method now includes a new overload to add attachment as streams.

Code Example:

// Add the streamed attachment (lazy loading)
msg.getAttachments().add("test.bin", inputStream);
// Save the MapiMessage with the streamed attachment
msg.save("output");