Free Support Forum -

MapiMessage from GraphClient has strange save behavior

I am currently evaluating the GraphClient API in aspose email for java and have a problem with saving fetched Messages. With the following code:

  // === Fetch message ===
    GraphMessageInfo messageInfo = messageInfoColl.get(0);
    MapiMessage fetchedMessage = client.fetchMessage(messageInfo.getItemId());
    System.out.println(fetchedMessage.getSubject() + " " + fetchedMessage.getSenderEmailAddress() + " " + fetchedMessage.getDisplayTo() + " " + fetchedMessage.getBodyHtml());
    fetchedMessage.getAttachments().forEach(a -> System.out.println(a.getFileName()));
    FileOutputStream fStream2 = new FileOutputStream("c:/temp/test.msg");
    MsgSaveOptions msgSaveOptions = new   MsgSaveOptions(MailMessageSaveType.getOutlookMessageFormatUnicode());
    msgSaveOptions.setPreserveSignature(true);, msgSaveOptions);

Test äöü߀


in the console. However the saved message does neither contain recipients nor attachments and the body encoding looks broken.
Opening the message in Outlook
grafik.png (13.3 KB)
This is the original in Outlook
grafik.jpg (143.9 KB)

I am currently using aspose-email-21.1.2-jdk16.jar.


I have added a ticket with ID EMAILJAVA-34790 in our issue tracking system to further investigate this on our end. This thread has been linked with the issue so that we may notify you once issue will be addressed.


We have prepared a special hotfix catering this requirement. Can you please try using the hotfix Aspose.Email for Java 21.1.3.

Thanks you for the fast fix. I will do some testing and come back to you on monday!


You are welcome. We will look forward to hear from you.

Hi, Can I also get access to test this hotfix please? MapiMessage getBodyHtml() is returning some corrupted results for me on occasion.


You can download that from the following link.
Aspose.Email for Java 21.1.3.

The 21.1.3 update seems to have fixed the issue for me.
Thank you for your support.


Thank you for your feedback. We will also make this part of upcoming official release Aspose.Email for Java 21.2.

I have been using the 21.1.3 fix also and am no longer seeing the issue either.


It’s good to know that things are working on your end.

Hi, I was curious… do you have an estimate on the Aspose.Email for Java 21.2 release date?



It is going to be released by end of February 2021. We will share the intimation with you once it will be available.