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

Free Support Forum - aspose.com

MSG to EML: MapiMessage.Save Method Throws NullReferenceException

In this example, we are trying to convert an MSG payload to an EML file, but it throws null exception with no indication of the problem or what is being null at all. The msg might be corrupted for some reason, but I cannot know why unless we know the reason behind the Null reference. Attached the sample project commented with more details.

AsposeTesting.zip (3.3 MB)

@bahakh,
Thank you for contacting support. I have reproduced the error.

There were many updates for Aspose.Email after version 20.8. Please use the latest version. It works fine.

Hi… We upgraded to 21.10 and we still have the same issue. It seems the bug still exists.

@bahakh,
I have tested again and received the same results:

  • in Aspose.Email 20.8, MapiMessage.Save method throws NullReferenceException
  • in Aspose.Email 21.10, there were no exceptions

Please try using Load method instead of FromFile as follows:

var original = MapiMessage.Load("Original.msg");

If the issue persists, please specify the OS version where the error occurs.