Read MS Outlook PST Files in C# .NET

Read MS Outlook PST Files in C# .NET

PST (Personal Storage Table) is a storage file format that is used by different Microsoft programs such as MS Outlook, Exchange, and Windows Messaging. PST files are capable of storing messages, contacts, calendars, events, etc. In certain cases, you may need to parse a PST file and extract data from it programmatically. To achieve that, this article shows how to read MS Outlook PST files using C# .NET. Particularly, you will learn how to extract folders’ information, read emails and fetch contacts from a PST file.

.NET API to Read Outlook PST Files

Aspose.Email for .NET is a powerful email processing API that lets you create and send emails from within .NET applications. In addition, it supports working with popular email and storage file formats. We will use this API to read folders’ information, messages, and contacts from PST files. You can either download the API or install it via NuGet.

PM> Install-Package Aspose.Email -Version 22.3.0

Read an Outlook PST File in C# .NET

The following are the steps to read a PST file and extract its information in C#.

The following code sample shows how to parse a PST file and fetch folders’ information.

Read Emails from a PST File in C#

Emails are the major entities that are stored in PST files by MS Outlook. So let’s see how to read email messages from a PST file in C#.

The following code sample shows how to extract messages from a PST file in C# .NET.

Extract Contacts from a PST File in C#

In certain cases, you may need to extract the contacts’ information stored in a PST file. The following steps demonstrate how to access the contacts in a PST file in C#.

The following code sample shows how to extract contacts from a PST file in C#.

Get a Free API License

You can try Aspose.Email for .NET for free by getting a temporary license.

Conclusion

In this article, you have learned how to read PST files programmatically in C# .NET. Furthermore, you have seen how to read folder information, fetch emails, and extract contacts from a PST file in C#. Besides, you can explore more about Aspose.Email for .NET using documentation. Also, you can share your questions or queries on our forum.

See Also