Working with Outlook Contacts
Creating, Saving and Reading Contacts
Like MapiMessage, Aspose.Email allows you to create Outlook contacts. The MapiContact class provides all the contact related properties required to create an Outlook contact. This article shows how to create, save and read an Outlook contact using the MapiContact class.
Create and Save Outlook Contact
To create a contact and save it to disc:
- Instantiate a new object of the MapiContact class.
- Enter contact property information.
- Add photo data (if any).
- Save the contact as MSG or VCard format.
The following code snippet shows you how to create and save outlook contact.
Save Contact in Version 3 VCF Format
To save the contact in version 3 VCF format, use the VCardVersion enumerable to set the VCardSaveOptions.Version property. The following sample code demonstrates the use of VCardVersion enumerable to save the contact VCF version 3 format.
Reading a MapiContact
Loading a Contact from MSG
The following code snippet shows you how to load contacts from MSG.
Loading a Contact from VCard
The following code snippet shows you how to load contacts from VCard.
Loading a Contact from VCard with Specified Encoding
The following code snippet shows you how to load contacts from VCard with the specified encoding.