We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Can we add EML to PST?


Is it possible to add EML directly to PST?

Hi Aaron,

Thank you for your inquiry.

At present, there is significant difference between the structures of EML and MSG formats and this can’t be achieved as PST only accepts MapiMessage format data. This needs the MailMessage conversion methods and require time to be implemented. We have a ticket with id: EMAILNET-34123 that is based on the same requirement and work is in progress for implementation of it. We shall share the fix version information here with you as soon as it is available for download.

<span style=“font-size:12.0pt;line-height:115%;
minor-latin;mso-bidi-font-family:“Times New Roman”;mso-bidi-theme-font:minor-bidi;
found solution to add EML files into PST format. https://goo.gl/7uQIp2

Hi Amelie,

That certainly adds the EMLs to PST, but you need to have MS Outlook installed and the process is manual. When there is automation required via an application, Aspose.Email API is handful. You can use the API to develop applications that can load EML files from disc, convert to MapiMessage and add to PST. However, adding EML files directly to the PST is not possible at the moment as we have shared earlier in this post. Please feel free to write to us if you have any further query about this requirement.

Hi Waqas

Is there any news about this?


The feature is still pending for implementation due to the complexity involved. We’ll notify you here once the fix version is available for download.

can we pass the path of a folder in a pst file and it generate the folder hierarchy accordingly to the passed in the funcion in java…


Thank you for contacting Aspose Support.
Please share additional details regarding your requirements so that we can assist you further.

Is there any method in java email so that i can create folder hierarchy in pst.
for ex: I have folder hierarchy in string form like this, Inbox/a,Inbox/b,Inbox/c , a/b,a/c.
where “Inbox” is the parent of “a”,“b”,“c” and “a” has child named as “b” so on…


You may achieve this by using the code snippet given below.

FolderInfo rootFolder = personalStorage.getRootFolder();
FolderInfo inbox = rootFolder.getSubFolder("Inbox");

Moreover, we have logged a new feature request as EMAILJAVA-34454 for adding subfolders in PST using string notation. We will update you here as soon as additional information is available.

if have an array like this [root, a,b,c] and i want to create subfolders like this : root/a/b/c , how could i do this by using given code.


Please use the code snippet given below to generate the desired subfolders.

String[] folders = new String[]{"root", "a","b","c"};
FolderInfo selectedFolder = personalStorage.getRootFolder();

for(String folder : folders){
    selectedFolder = createFolder(selectedFolder, folder);

private static FolderInfo createFolder(FolderInfo Folder, String newFolder) {
        return Folder.getSubFolder(newFolder);

We hope that this answered your question. Please feel free to reach us if additional information is required.

The issues you have found earlier (filed as EMAILJAVA-34454) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by muhammadahmad