Sign In  Sign Up Live-Chat

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

Last post 07-26-2008, 5:40 AM by saqib.razzaq. 1 replies.
Sort Posts: Previous Next
  •  07-25-2008, 10:52 AM 136969

    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
     
  •  07-26-2008, 5:40 AM 137042 in reply to 136969

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

    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. And the source code of the demo can be downloaded from http://www.aspose.com/community/files/54/utility-components/aspose.network/entry130065.aspx.


    Best Regards,

    Saqib Razzaq
    Support Developer
    Aspose Guangzhou Team

     
View as RSS news feed in XML