Free Support Forum -

MapiMessage.FromFile() fails

Using Aspose.Network version 6.8, MapiMessage.FromFile() fails when opening some MSG files, including the attached one:

System.InvalidCastException: Unable to cast object of type 'System.IO.MemoryStream' to type '?.?'.
at ?.?.?(String )
at .e.?(IMapiPropertyContainer , , ? )
at ..?(IMapiPropertyContainer , , , ? )
at .e.?(IMapiPropertyContainer , , ? )
at Aspose.Network.Outlook.MapiMessageReader.ReadMessage()
at Aspose.Network.Outlook.MapiMessage.FromStream(Stream stream)
at Aspose.Network.Outlook.MapiMessage.FromFile(String path)

Can this be addressed? Thank you,

Hi Rob,

Thank you for inquiry.

I managed to reproduce the issue (ID: 30594) at my end. But, I could not open this MSG file with Outlook 2010, it gave error message “The end data you entered occurs before the start date” and just quits without opening the message.

We will see if anything could be done at our end and will update you accordingly.

I have attached a different file for you to try to replicate this error. This file produces the same error as the previous one, but I can open this file in Outlook.

I also included a screenshot of the error as it appears in Notepad.exe (slightly different from how it appears after posting to the website).

Thank you,


Hi Rob,

Thanks for posting the file.

I have reproduced the issue with this one and logged this bug in our system (ID: 30762). We will look into it and will inform you when it gets fixed.

Hello Rob,

The attached MSG file contains some corrupted nested messages, Outlook also gives error when you try to open these. In Aspose.Email 1.1, we will throw exception message on loading such MSG file.

Later on, we will also look into the possibility of reading other data from erroneous MSG files (Issue ID: 31298).

The issues you have found earlier (filed as 30762 ) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.