Read MS Outlook PST Files in Java

PST (Personal Storage Table) is a well-known file format that is used for storage purposes by different Microsoft programs such as MS Outlook, Exchange, and Windows Messaging. PST files can store messages, contacts, and information about other items such as 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 Outlook PST files in Java. With the help of code samples, you will learn how to extract folders’ information, read emails and fetch contacts from a PST file.

Java API to Process Outlook PST File - Free Download

Aspose.Email for Java is a popular and feature-rich email processing API for creating and sending emails. In addition, it allows you to work with popular email clients and storage file formats. In this article, we will use Aspose.Email for Java to read messages and other information from PST files. You can either download the API or install it using the following Maven configurations.

Repository:

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>http://repository.aspose.com/repo/</url>
</repository>

Dependency:

    <groupId>com.aspose</groupId>
    <artifactId>aspose-email</artifactId>
    <version>22.3</version>
    <classifier>jdk16</classifier>
</dependency>

Read an Outlook PST File in Java

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

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

Java Read Emails from a PST

The following are the steps to read email messages from a PST file in Java.

The following code sample shows how to extract messages from a PST file in Java.

Read Contacts from a PST in Java

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

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

Java API to Read Outlook PST File - Get a Free License

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

Conclusion

In this article, you have learned how to read PST files programmatically in Java. Furthermore, you have seen how to extract folder information, fetch emails, and retrieve contacts from a PST file in Java. In addition, you can explore more about Aspose.Email for Java using documentation. Also, in case you would have any questions or queries, feel free to let us know via our forum.

See Also