Browse our Products

Aspose.Email for Java 25.2 Release Notes

All Changes

KeySummaryCategory
EMAILNET-41500Add Support for Filtering or Searching Messages in MBOX FilesFeature
EMAILNET-41517Implement methods for paginated retrieval of items from MBOX filesFeature
EMAILJAVA-35339PS_INTERNET_HEADERS x-ms-journal-report named property missing for PST entryBug
EMAILNET-41507Null reference exception is thrown when saving MapiCalendar with recurrence and time zonesBug
EMAILNET-41506Exception when converting email to MHT with SkipInlineImages set to trueBug
EMAILNET-41504Incorrect date shift when processing EML files in GMT+2 time zoneBug
EMAILNET-41501Senders email address is incorrect format when Converting .msg to .emlBug
EMAILJAVA-35347Aspose.Email does not embed images into htmlFeature

New Features

1. Support for Filtering or Searching Messages in MBOX Files

Aspose.Email for Java now provides the ability to filter or search messages within MBOX files using a query. This enhancement allows developers to efficiently retrieve only the messages that match specific criteria, improving performance and usability when working with large MBOX files.

API Changes:

  • Added enumerateMessages(MailQuery query), which returns an enumerable collection of MailMessage instances that match the specified query.
  • Added enumerateMessageInfo(MailQuery query), which returns an enumerable collection of MboxMessageInfo instances that match the specified query.

Code Example:

MboxStorageReader reader = MboxStorageReader.createReader("input.mbox", new MboxLoadOptions());
MailQueryBuilder mqb = new MailQueryBuilder();
mqb.getSubject().contains("Project Update");
mqb.getSentDate().before(new Date());

for (MailMessage message : reader.enumerateMessages(mqb.getQuery())) {
    System.out.println("Subject: " + message.getSubject());
}

2. Support for Paginated Retrieval of Messages from MBOX Files

Aspose.Email for Java now supports paginated retrieval of messages from MBOX files. This feature allows for efficient processing of large MBOX files by retrieving messages in smaller batches, reducing memory consumption and improving performance.

API Changes:

  • Added enumerateMessages(int startIndex, int count), which retrieves a specified number of MailMessage instances starting from a given index.
  • Added enumerateMessageInfo(int startIndex, int count), which retrieves a specified number of MboxMessageInfo instances starting from a given index.

Code Example:

MboxStorageReader reader = MboxStorageReader.createReader("input.mbox", new MboxLoadOptions());
int startIndex = 0;
int count = 10; // Retrieve messages in batches of 10

for (MailMessage message : reader.enumerateMessages(startIndex, count)) {
    System.out.println("Subject: " + message.getSubject());
}

3. Support for Extract HTML body resources as attachments

Aspose.Email for Java now supports extracting image-linked content from the HTML body and embedding it as attachments in MIME messages. This enhancement ensures that linked images are preserved and properly associated with the email, improving content integrity and offline accessibility.

API Changes:

  • Added HtmlSaveOption.ExtractHTMLBodyResourcesAsAttachments, defines whether to extract HTML body resources as attachments

Code Example:

MailMessage mailMessage = MailMessage.load("input.eml");
HtmlSaveOptions options = new HtmlSaveOptions();
options.setExtractHTMLBodyResourcesAsAttachments(true);
options.setResourceHtmlRenderingHandler(new ResourceHtmlRenderingHandler() {
    public void invoke(final Object sender, final ResourceHtmlRenderingEventArgs e) {
        System.out.println(e.getPathToResourceFile() + " " + ((Attachment)sender).getContentId());
    }
});