Aspose.Email  for Node.js via .NET

Open OST Files & Extract Email Data in Node.js

Open and read OST files in JavaScript, accessing emails, contacts, and calendar data programmatically within Node.js applications.

OST Reader for Node.js Applications

Aspose.Email for Node.js via .NET empowers developers with a functional Node.js API to work with Outlook Offline Storage Table (OST files). Whether you need to open OST files, extract data, or parse their contents, this library simplifies complex tasks by offering a rich set of features specifically designed for email and messaging applications. With its intuitive interface and extensive capabilities, Aspose.Email for Node.js via .NET is an ideal choice for developers seeking efficiency and accuracy.

The library saves developers countless hours by offering high-performance, ready-to-use functions that eliminate the need to develop custom parsers or data extractors.

Reading & Parsing OST Files: How it works with Aspose.Email in Node.js

The parsing process involves just a few steps with Aspose.Email:

  1. First, spare a minute to import Aspose.Email to access its OST file handling features via npm install aspose.email command.

  2. Use PersonalStorage.fromFile() to open an OST file (e.g., “sample.ost”).

  3. Retrieve the root folder of the file using getSubFolder() .

  4. Use getContents() to extract all email messages in the folder.

  5. Loop through each message and print its subject and body.

 

OST file parsing using Node.js via .NET

// Load the Aspose.Email library
const ae = require('@aspose/email');

// Load the OST file
const ost = ae.Storage.Pst.PersonalStorage.fromFile("sample.ost");

// Access folders
const folder = ost.rootFolder.getSubfolder("Inbox");

// List messages in the OST
const messages = folder.getContents();

messages.forEach(message => {
    console.log(`Subject: ${message.subject}`);
    console.log(`Body: ${message.body}`);
});
 

Outlook Items Extraction - Contacts & Calendar

One useful feature when reading OST files is accessing and parsing Outlook items such as calendar events and contacts. Developers can easily implement this feature into their Node.js projects using Aspose.Email for Node.js via .NET.

 

Read Outlook calendar events and contacts from OST in Node.js

// Load the Aspose.Email library
const ae = require('@aspose/email');

// Load the OST file
const ost = ae.Storage.Pst.PersonalStorage.fromFile("sample.ost");

// Access the Calendar and Contacts folders
const calendarFolder = ost.getPredefinedFolder(ae.Storage.Pst.StandardIpmFolder.Appointments);
const contactsFolder = ost.getPredefinedFolder(ae.Storage.Pst.StandardIpmFolder.Contacts);

// Read Existing Calendar Events
const calendarEvents = calendarFolder.getContents();
calendarEvents.forEach(event => {
    console.log(`Event Subject: ${event.subject}`);
    console.log(`Start Date: ${event.startDate}`);
    console.log(`End Date: ${event.endDate}`);
});

// Read Existing Contacts
const contacts = contactsFolder.getContents();
contacts.forEach(contact => {
    console.log(`Contact Name: ${contact.displayName}`);
    console.log(`Email: ${contact.email1Address}`);
});
 

File Format Support

Make your OST files accessible offline or simplify their migration process by saving them in PST format. This process, also known as conversion, can be done with one line of code.

  1. Load an OST file.
  2. Save it in PST format.
 

OST to PST conversion in Node.js via .NET

// Load the OST file
const personalStorage = ae.Storage.Pst.PersonalStorage.fromFile("PersonalStorageFile.ost");

// Save as a PST file
personalStorage.saveAs("test.pst", ae.Storage.Pst.FileFormat.Pst);
 

Similarly, OST files can be converted into other formats such as EML, MSG, MBOX, HTML, and more, giving flexibility to work across different platforms.

About Aspose.Email Node.js API

Aspose.Email for Node.js via .NET is a powerful library that offers a robust set of tools designed to empower developers in handling email data with ease. Its extensive features include:

  • Managing and manipulating email messages, contacts, calendars, and other Outlook data within Node.js applications.

  • Working with popular email formats (like MSG, EML, and MHTML) - from email creation to parsing, conversion, and management.

While the library currently provides essential email data handling features, it’s actively developing and will include many more capabilities in future updates, further expanding its functionality.

Install Aspose.Email for Node.js via .NET

To start using Aspose.Email for PST processing, install it via npm:

 

Command


npm install @aspose/email
 

System Requirements

Before running the code, make sure you have the following prerequisites:

  • Microsoft Windows or Mac OS X, Linux (Ubuntu, CentOS and others).
  • Development environment like Visual Studio Code.
  • Node.js version (with npm) from nodejs.org.

Reading Other Formats

Explore other file formats that the API can handle with ease.

MBOX (Electronic Mail Messages)
OLM (Outlook for Mac Archive)
PST (Outlook Personal Storage Files)
TGZ (Compressed Archive Files)