Creating PST using Java component

I need to create PST file using Java. Could you guide me how I can do it?

Hi Ashish,

We are sorry for a delayed response.

Please have a look at the following code sample for creating PST using Aspose.Email for Java. If you have any query/inquiry related to Aspose.Email, please feel free to write to us. We’ll be glad to assist you further.

Sample Code:

// Create a new Pst on Disc
PersonalStorage pst = PersonalStorage.create("TestPst.pst", FileFormatVersion.Unicode);

// create predefiend Inbox folder in PST
FolderInfo fi = pst.createPredefinedFolder("Inbox", StandardIpmFolder.Inbox);

// Load a MSG from disc
MapiMessage mapi = MapiMessage.fromFile("TestMessage.msg");

// add the MSG to Inbox folder
fi.addMessage(mapi);

pst.dispose();