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

Free Support Forum - aspose.com

Aspose.Email.Outlook.MapiMessage.Headers exception

This code throws a "Specified cast is not valid" exception:

string from = mapiMessage.Headers["From"];

I wrap this line in a try/catch block, but I thought you'd want to know you're assuming a cast succeeds here.

Best regards,

Hi Rob,

I am afraid that I am unable to reproduce your said exception with latest version of Aspose.Email for .NET v1.3.0. Below is my sample code for your reference.

var message = Aspose.Email.Outlook.MapiMessage.FromFile(“message.msg”);
string key = message.Headers[“From”];

Please share a problematic message for our review.

Thanks and Regards,