We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Java example from Aspose Github throwing an exception


I’m trying to run the following code from Aspose example file (https://github.com/aspose-email/Aspose.Email-for-Java/blob/master/Examples/src/main/java/com/aspose/email/examples/outlook/pst/AddMapiNoteToPST.java):

MapiMessage mess = MapiMessage.fromFile(dataDir + “Note.msg”);

// Note #1
MapiNote note1 = (MapiNote) mess.toMapiMessageItem();

This code throws the following error message:

com.aspose.email.MapiMessage cannot be cast to com.aspose.email.MapiNote

How can I do to run this code?



Can you please share that which API version you have used on your end to reproduce the issue.




I have created a ticket with ID EMAILJAVA-34746 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be addressed.