Read contact information in msg file

Aspose.Email.Outlook.MapiMessage msg = Aspose.Email.Outlook.MapiMessage.FromFile(@path);


Aspose.Email.Outlook.MapiContact contact = (Aspose.Email.Outlook.MapiContact)msg.ToMapiMessageItem(); <----- Problem

My MapiMessage are loaded with no problem, but when i try to get contact information from, i receive the error :

An unhandled exception of type ‘System.ArgumentException’ occurred in Aspose.Email.dll

Additional information: Email address is not valid

When i click the file directly, my outlook open it with no problem and show all the informations.

I get the same error for the MapiNote.

I read almost every post subject and i didnt find anything about.

Thanks to help.

Hi Eric,


Thank you for posting your inquiry.

We don’t face any issue while loading MS Outlook generated Contact or Notes MSG file. Can you please share your sample files with us for our investigation? We shall analyze these and report the problem if it is really an issue with the API. Please don’t forget to try with the latest version of the API i.e. Aspose.Email for .NET 5.5.0.

I used the version 5.5.0 from nuget manager. It look like somes files are ok and somes no.

I attached one working file in the zip and one with the error i get. Maybe you could say the difference between. I exported all contact .msg in the same way.

My code are really basic in moment, the problem come from the file maybe.

Aspose.Email.Outlook.MapiMessage msg = Aspose.Email.Outlook.MapiMessage.FromFile(@path);

//IPM.Contact 1
Console.WriteLine(msg.MessageClass);

Aspose.Email.Outlook.MapiContact contact = (Aspose.Email.Outlook.MapiContact)msg.ToMapiMessageItem();

Hi Eric,


Thank you for sharing your sample MSG file.

We have tested this with the latest version of Aspose.Email for .NET 5.5.0 but were not able to face any exception. Can you please share if you have attached the correct problematic MSG file for our investigation?

On 1620 files, i have around 320 problematics files like (2002) Ltée in the zip i shared. If you didnt get any exception with (2002) Ltée, i have to investigate more on my side to understand why then i receive exception on my side.


Thanks


Hi Eric,

We could not find more than one MSG file in the zip you provided earlier. Can you please confirm if you provided the correct zip archive to us? We shall investigate the problem in more detail and assist you further.

I put 2 incorrects files in this zip. I wish you will get the same error then me this time.

Hi Eric,

Thank you for sharing the problematic files. We were able to reproduce the issue at our end and have logged it as EMAILNET-34939 in our issue tracking system for further investigation by our Product team. We’ll update you here once there is some information available in this regard.