How to read emails from *.pst file in c#
HI. I want to read emails from *.pst without connecting Outlook or other applications.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Uehara AyakaPosted Jan 5, 2018, 3:34 AM
Hussam BarouqaPosted Jan 4, 2018, 10:55 AM
Sagar Pandurang KapPosted Jan 3, 2018, 5:49 AM
you need to first add refrence to the page Microsoft.Office.Interop.Outlook;
Outlook.Application olApp = new Outlook.ApplicationClass();
olApp.Session.AddStore(“PST path here”);
Outlook.MAPIFolder folder = OlApp.Getnamespace(“MAPI”).Folders.GetLast();
Outlook.Items items = folder.items;
foreach (Outlook.MailItem item in folder.items)
Hope it helps..{
Console.WriteLine(item.SenderEmailAddress + ” ” + item.Subject + “\n” + item.Body);
}