Adding MapiDistributionList to PST

Create New PST, Add Sub-folders and Messages showed how to create a PST file and add a subfolder to it. With Aspose.Email you can add a MapiDistributionList to the Contacts subfolder of a PST file that you have created or loaded.

Load MapidistributionList from file

The code below loads a MAPI distribution list from a file.

Create a New MapiDistributionList and Add it to the Contacts Subfolder

Below are the steps to add a MapiDistributionList to a PST:

  1. Create a new PST.
  2. Add the Contacts folder to PST.
  3. Create sample contacts.
  4. Create a distribution list on the base of the created contacts.
  5. Add the distribution list to PST.

The code snippet below shows how to create a MapiDistributionList and then add it to the Contacts folder of a newly created PST file.

Create a One-off Distribution List

For this distribution list, no separate contacts are required.