Free Support Forum -

When does MapiMessage.getMessageClass() method can return null? (Java)

I have some code which does MapiMessage.fromFile(fileName).getMessageClass() using aspose-email for java 19.7 and it is returning null for that String value.

Under what circumstances is that expected behavior?



I request you to please share the sample MSG file and working sample code with us so that we may investigate it further on our end. I also suggest you to please first try using latest Aspose.Email for Java 19.8 as well on your end.


I tried with 19.8 and got the same null back. the msg is attached here


is returning null for this msg (2.6 KB)


I have observed the sample file shared by you. An issue with ID EMAILJAVA-34580 has been created 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 fixed.


We have investigated the issue on our end. The message file is corrupted and according to docs property value can be located in a separate stream called:


In the message file wrong name is used:


Please refer to this web link for your further kind reference as well.