Is PST Generation Supported via Aspose in Node.js?

Hello Team,

I’m working on a Node.js-based application where we need to programmatically package .eml files into a PST file. I’d like to know if Aspose provides any npm package or JavaScript/TypeScript SDK that directly supports this functionality.

During my research, I came across the following options:

  • The @aspose/email npm package — however, it doesn’t appear to support PST creation.
  • Aspose.Email Cloud API — this seems to require uploading EML files to the cloud, which we would like to avoid due to privacy constraints.
  • Aspose.Email for Java/.NET — this supports PST creation but isn’t natively compatible with a Node.js environment and requires a Java runtime.

Could you please confirm whether there is any official Node.js SDK or npm package that supports PST creation? If not, what would be the recommended way to integrate this capability into a Node.js workflow? Any guidance, sample code, or documentation would be greatly appreciated.

Looking forward to your guidance.

Thank you!

Hello @SudhanshuPanwar,

Welcome to our support forum!

Yes, the @aspose/email npm package does support creating PST files from a Node.js environment, no need for cloud services or Java runtime.

Here’s a sample that shows how to add a .eml to a new PST:

const ae = require('@aspose/email');

const eml = new ae.MailMessage();
eml.from = new ae.MailAddress("from@domain.com");
eml.subject = "MailMessage to be added to PST";
eml.htmlBody = "<b>This is a test email</b> added to a PST file.";
eml.to.add(new ae.MailAddress("to@domain.com", "Recipient"));

const pst = ae.Storage.Pst.PersonalStorage.create("output.pst", ae.Storage.Pst.FileFormatVersion.Unicode);
const inbox = pst.rootFolder.addSubFolder("Inbox");
inbox.addMessage(ae.Mapi.MapiMessage.fromMailMessage(eml));

console.log("MailMessage successfully added to PST.");

Thank you.