Aspose.Email for Android via Java 20.7 Release Notes

All Changes

KeySummaryCategory
EMAILNET-39844Message to HTML - how to preserve embedded attachment’s icons and textFeature
EMAILNET-39852Support for getting Email Category in MHTMLFeature
EMAILNET-39876Support for countering endless wait or zombie condiation for Aspose.Email operationsFeature
EMAILNET-39794Set Timezone is not visible in MS Outlook 2016Enhancement
EMAILJAVA-34701Multipart/related part marked with content-dispotion attachment missing in MailMessageEnhancement
EMAILJAVA-34700Text wrapping getting disturbed in case of lengthy CC/TO fields in exported PDFEnhancement
EMAILNET-39835Add overload for SaveAs with Stream input in PersonalStorageEnhancement
EMAILNET-39834Add overload for MergeWith with Streams in PersonalStorageEnhancement
EMAILNET-39860MapiCalendar does not have public property for organizerEnhancement
EMAILNET-39858No messages are read from MBOXEnhancement
EMAILNET-39843Text wrapping getting disturbed in case of lengthy CC/TO fields in exported PDFEnhancement
EMAILJAVA-34726Provision to make IDisposible extend CloseableEnhancement
EMAILNET-39823Can’t save MailMessage with default DateBug
EMAILNET-39705Meeting opened as appointment in saved PST when viewed in MS OutlookBug
EMAILNET-39803Office 365 Recurrence ICS not getting AppendedBug
EMAILNET-39811Extra symbols are in the message bodyBug
EMAILJAVA-34691Memory issue loading MapiMessageBug
EMAILNET-39818MSG to MHTML wrong sent time extractedBug
EMAILNET-39820Aspose.Email: there are unclosed tags in the HtmlBody after loading an .msg fileBug
EMAILJAVA-34697Erroneous meeting end times on recurring meetingsBug
EMAILNET-39816Parsing Appointment resulting recurrency error rule errorBug
EMAILNET-39839Table borders disappeared while converting msgBug
EMAILNET-39871Embedded images appearing in attachments of save MSGBug
EMAILNET-39853Attachments lost during Appointment to MapiCalendar conversionBug
EMAILNET-39856EML Content are not read properlyBug
EMAILNET-39865NullReferenceException on extracting messages form PSTBug
EMAILNET-39854Incorrect PropertyDescriptor’s for the named properties in MapiMessage.PropertiesBug
EMAILJAVA-34707Exception on adding msg to PST in MAC OSBug
EMAILNET-39861MapiCalendar does not save Attendees to ICSBug
EMAILNET-39842Multipart/related part marked with content-dispotion attachment missing in MailMessageBug
EMAILNET-39873API hangs on exporting MSG to MHTMLBug
EMAILNET-39885Incorrect parsed EML-File with Aspose.EmailBug
EMAILNET-39874Colors of text are lost in exported MHTBug

New Features

Render custom icons in message attachment while HTML conversion

Sometimes, the message contains in-line attachments, that are shown up as icon images in a message body. Such messages may create problems while converting them to HTML, since the icon images are lost. This is because attachment’s icons are not held directly in the message.

We have fixed this problem so that the user can customize the icons for attachments when converting the message to HTML. For that, the HtmlSaveOptions.ResourceHtmlRendering event has been added:

HtmlSaveOptions options = new HtmlSaveOptions();
options.setResourceHtmlRenderingHandler(new ResourceHtmlRenderingHandler() {
   @Override
   public void invoke(Object sender, ResourceHtmlRenderingEventArgs e) {
        AttachmentBase attachment = (AttachmentBase) sender;
        e.setCaption(attachment.getContentType().getName());
       if (attachment.getContentType().getName().endsWith(".pdf")) {
            e.setPathToResourceFile("pdf_icon.png");
       } else if (attachment.getContentType().getName().endsWith(".docx")) {
            e.setPathToResourceFile("word_icon.jpg");
       } else if (attachment.getContentType().getName().endsWith(".jpg")) {
            e.setPathToResourceFile("jpeg_icon.png");
       } else {
            e.setPathToResourceFile("not_found_icon.png");
       }
   }
});

options.setResourceRenderingMode(ResourceRenderingMode.SubstituteFromFile);
String fileName = "message.msg";
MailMessage mailMessage = MailMessage.load(fileName);
mailMessage.save("fileName.html", options);

Get Email Category in MHTML

We have introduced the ability to add a category header while converting message to MHML.

MapiMessage msg = new MapiMessage("from@aaa.com", "to@aaa.com", "subj", "body");
msg.setCategories(new String[] { "Urgently", "Important" });
MhtSaveOptions saveOptions = new MhtSaveOptions();
saveOptions.getFormatTemplates().set_Item(MhtTemplateName.CATEGORIES,
    saveOptions.getFormatTemplates().get_Item(MhtTemplateName.CATEGORIES).replace("Categories", "Les catégories"));

saveOptions.getRenderingHeaders().add(MhtTemplateName.CATEGORIES);
msg.save("fileName.mhtml", saveOptions);

Create PST with size more than 2Gb using OutputStream

The user can optimize PST internal cache using new PersonalStorage API method:

blockSize - The optimal block size to expand cache buffer(in bytes)

PersonalStorage create(OutputStream stream, int blockSize, /*FileFormatVersion*/int version)

Using Timeout for Countering Endless Wait Operations While Saving Message to MHT Format

Sometimes, when processing a corrupted message, an operation may be performed infinitely and thus impair the correct functionality of the application. By using a configurable timeout, you can stop a stuck operation, handle the event, and continue executing the application.

We have added the following members to MhtSaveOptions class:

  • MhtSaveOptions.getTimeout, setTimeout - Limits the time in milliseconds of formatting message. The default value is 3000 milliseconds.
  • MhtSaveOptions.getTimeoutReachedHandler, setTimeoutReachedHandler - Raised if timed out while saving to MHTML.

Code sample:

String emlFileName = "input.eml";
String mhtFileName = "output.mhtml";

MailMessage mailMessage = MailMessage.load(emlFileName);
MhtSaveOptions options = SaveOptions.getDefaultMhtml();
options.setTimeout(4000);
options.setTimeoutReachedHandler(new TimeoutReachedHandler() {
    public void invoke(Object sender, EventArgs e) {
        //handler
    }
});
mailMessage.save(mhtFileName, options);

The Try-With-Resources Statement

We have added a java.io.Closeable implementation for all classes that implement IDisposable.

try (PersonalStorage pst = PersonalStorage.fromFile(fileName, false)) {
    // pst.
}

try (MboxStorageReader reader = MboxStorageReader.createReader("fileName", false)) {
    //reader.
}