Aspose.Email  for .NET

How to Merge OST Files in C#

Intuitive and high-performance .NET API to merge OST files.

Merging OST (Offline Storage Table) files lies in consolidation of multiple OST files into a single file, making it easier to manage and access email data. A robust and effective solution to this task is Aspose.Email for .NET which empowers developers to efficiently manage OST files and enables them to allocate their time and efforts towards more critical and rewarding aspects of their projects. Aspose.Email for .NET is a versatile API providing powerful features and functionalities to streamline the merging of OST files as well as handling a variety of other challenging email-related tasks.

The API offers capabilities to seamlessly merge multiple OST files while ensuring data integrity, maintaining folder structures, and preserving email properties. By leveraging Aspose.Email for .NET, developers can automate the merging process, significantly reducing the manual effort and complexity involved in managing multiple OST files, thus improving overall productivity.

The .NET API is easy to install and utilize. Start optimizing your data management with Aspose.Email for .NET by performing one of the following actions:

  • Open NuGet package manager, search for Aspose.Email and install it on your device.

  • Use the following command from the Package Manager Console:

PM> Install-Package Aspose.Email

Steps for Merging OST Files in C#

A basic document merging and concatenating with Aspose.Email for .NET APIs can be done with just few lines of code.

  1. Define an array of source OST file names using string sourceOstFiles.
  2. Create a new PST file using PersonalStorage.Create() method, specifying the file name and format version.
  3. Subscribe to the events for tracking process.
  4. Merge the created PST with the OST files using pst.MergeWith() method, passing the array of source OST file names.

OST files are merged into one PST, because they can’t be created from scratch.

System Requirements

Our APIs are supported on all major platforms and Operating Systems. Before executing the code below, please make sure that you have the following prerequisites on your system.

  • Microsoft Windows or a compatible OS with .NET Framework, .NET Core, Windows Azure, Mono or Xamarin Platforms
  • Development environment like Microsoft Visual Studio
  • Aspose.Email for .NET DLL referenced in your project - Install from NuGet using the Download button above

Merge OST Files - C#

string[] sourceOstFiles = { "source1.ost", "source2.ost", "source3.ost", ... "sourceN.ost" };
using (var pst = PersonalStorage.Create("target.pst", FileFormatVersion.Unicode))
    // The events subscription is an optional step for the tracking process only.
    pst.StorageProcessed += PstMerge_OnStorageProcessed;
    pst.ItemMoved += PstMerge_OnItemMoved;
    // Merges with the pst files that are located in separate folder. 
  • About the API

    Aspose.Email for .NET is a powerful and reliable API for working with email messages, contacts, calendars, and other email-related tasks in .NET applications. It provides a wide range of features such as creating, reading, and manipulating email messages, managing contacts and calendars, sending and receiving emails, and working with various email formats including PST, MSG, EML, and MHT. The API is designed to be easy to use and flexible, making it a great choice for integrating email functionality into .NET applications.

    Aspose.Email provides free access to its resources:

    • a comprehensible documentation with thorough instructions on all supported features
    • support forum providing professional answers to all possible questions
    • the blog with a collection of posts on urgent issues
    • advanced features of the library

    The API is standalone and does not require Microsoft Outlook or any other software installation.

    OST What is OST File Format

    OST or Offline Storage Files represent user's mailbox data in offline mode on local machine upon registration with Exchange Server using Microsoft Outlook. It is automatically created on the first use of Microsoft Outlook upon connectivity with server. Once the file is created, the data is synchronized with the email server so that it is available offline as well in case of disconnectivity from email server. OST files can user mailbox items such as emails, contacts, calendar information, notes, tasks and other similar data. Users can create emails and other data items in OST file even in the absence of connection to the server, but these will not be synchronized with the server. Once the connection is established, the local file is synchronized with the server again so that both the server and the local copy are at the same level of information.

    Read More