Adding MapiDistributionList to PST
Contents
[
Hide
]
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.
In order to set the EntryId for a MapiDistributionListMember, the base64String needs to be converted using Apache Commons Codec.
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:
- Create a new PST.
- Add the Contacts folder to PST.
- Create sample contacts.
- Create a distribution list on the base of the created contacts.
- 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.