Java example from Aspose Github throwing an exception

Hi,

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?

Thanks

@kelberuc

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

@mudassir.fayyaz

Aspose.Email-20.9

@kelberuc

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.