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

Free Support Forum - aspose.com

How read From- To from a .MSG file saved in c drive using c#.net

Hi i am new to .net application.

So can any one please send me the complete code which reads To, From, Subject from .MSG file saved in local system.

Can you please send it in c#.net?

Thanks in advance

This message was posted using Page2Forum from [Extracting Email Headers - Aspose.Network for .NET](http://www.aspose.com/documentation/utility-components/aspose.network-for-.net/extracting-email-headers.html)

Hi Krishna,

Thanks for considering Aspose.

Please find the sample code to read the To, From and Subject from an msg file. You just need to load the msg file in MapiMessage class and get the values of the respective properties.

Aspose.Network.Outlook.MapiMessage msg1 = Aspose.Network.Outlook.MapiMessage.FromFile(@"c:\temp\super.msg");

Console.WriteLine(msg1.SenderEmailAddress + msg1.DisplayTo + msg1.Subject);

You might also be interested in our demo application that loads the msg file and show the from, subject, to, attachments and more on a windows form application. The article that explains the code is written at [http://www.aspose.com/documentation/utility-components/aspose.network-for-.net/outlook-msg-file-viewer.html ](http://www.aspose.com/documentation/utility-components/aspose.network-for-.net/outlook-msg-file-viewer.html). And the source code of the demo can be downloaded from http://www.aspose.com/community/files/54/utility-components/aspose.network/entry130065.aspx