How to Add MapiCalendar to PST using C#

In this short topic, we will learn how to add MapiCalendar to PST using C# by adhering to well defined steps and using the example code. You can insert Mapi Calendar to PST in C# with the help of simple API calls. This application can be utilized in any of .NET supported environments in operating systems like Windows, Linux, or macOS.

Steps to Insert Mapi Calendar to PST in C#

  1. Set up the application to install Aspose.Email assembly from the NuGet package manager
  2. Use the MapiCalendar instances to add the Appointments Information
  3. Instantiate the MapiRecipientCollection object to add the meeting attendee list
  4. Create an empty PST file on the disk using the PersonalStorage class
  5. Create a folder with the name Calendar inside the PST storage
  6. Add the Appointments inside the PST storage folder

In order to add MapiCalendar to PST C# based API can be used by following the above mentioned steps. We will start by adding a couple of appointments by using instances of MapiCalendar class, which is then followed by adding the attendee list of the appointments using the MapiRecipientCollection class. Subsequently, an empty PST file is created on the disk and appointments are added to the newly created Calendar folder inside the PST.

Code to Add MapiCalendar to PST using C#

The above example in C# insert Mapi Calendar to PST file that is stored on a disk. You can also retrieve the PST file data and may upload that to an MS Outlook or any other client. The MapiCalendar offers rich customization that one can associate with any appointment including inserting attachments, normal body content, HTML body content, RTF body content, start date, end date and location to name a few. The MapiRecipient class also let you add the recipient information like recipient type, display name and recipient track status to monitor the response of the recipient for a suggested request.

In this guide, we learnt how to insert MapiCalendar to PST using C# based API. If you are looking to convert an email to HTML, refer to the article on how to convert Outlook Email to HTML using C#.

 English