MapiContact

MapiContact class

Inherits: Aspose::Email::Mapi::MapiMessageItemBase

Represents a MAPI contact item.

This class serves as a wrapper for MapiMessage to simplify the process of handling contact information from MAPI properties. It provides a more intuitive interface for accessing and manipulating contact data within the MAPI message.

The following exmaple demonstrates how to get MapiContact object from MapiMessage .

var msg = MapiMessage.Load("contact.msg");
 
// Check if the loaded message is a supported contact type
if (msg.SupportedType == MapiItemType.Contact)
{
 // Convert the MAPI message to a MapiContact object
    var mapiContact = (MapiContact)msg.ToMapiMessageItem();
 
 // Display some contact info
    Console.WriteLine(mapiContact.NameInfo.DisplayName);
    Console.WriteLine(mapiContact.ElectronicAddresses.Email1.EmailAddress);
}
Dim msg = MapiMessage.Load("contact.msg")
 
' Check if the loaded message is a supported contact type
If msg.SupportedType = MapiItemType.Contact Then
    ' Convert the MAPI message to a MapiContact object
    Dim mapiContact = DirectCast(msg.ToMapiMessageItem(), MapiContact)
 
 ' Display some contact info
    Console.WriteLine(mapiContact.NameInfo.DisplayName)
    Console.WriteLine(mapiContact.ElectronicAddresses.Email1.EmailAddress)
End If

Constructors

NameDescription
MapiContact (6 overloads)Initializes a new instance of the MapiContact class

Methods

NameDescription
ConvertToMapiMessageConverts contact object to mapi message
FromVCard (6 overloads)Reads MapiContact from the specified stream containing vCard. The supported vCard versions are 2.1 and 3.0
get_AttachmentsGets the attachments in the contact.
get_ElectronicAddressesSpecify properties for up to three different e-mail addresses and three different fax addresses
get_EventsSpecify events associated with a contact
get_GoogleIdUses to specify the server URI of the contact GmailClient only
get_NameInfoThe properties are used to specify the name of the person represented by the contact
get_OtherFieldsSpecify other fields of conhtact.
get_PersonalInfoSpecify other additional contact information
get_PhotoContains contact photo MapiContactPhoto .
get_PhysicalAddressesSpecify three physical addresses: Home Address, Work Address, and Other Address. One of the addresses can be marked as the Mailing Address
get_PidTagUrlNameUses to specify the server URI of the contact WebDav only
get_ProfessionalInfoProperties are used to store professional details for the person represented by the contact
get_TelephonesSpecify telephone numbers for the contact
GetUnderlyingMessageRetrieves the underlying MapiMessage object.
Save (6 overloads)Saves this MapiContact into the given stream with vCard format. The supported vCard version is 2.1
set_ElectronicAddressesSpecify properties for up to three different e-mail addresses and three different fax addresses
set_EventsSpecify events associated with a contact
set_GoogleIdUses to specify the server URI of the contact GmailClient only
set_NameInfoThe properties are used to specify the name of the person represented by the contact
set_OtherFieldsSpecify other fields of conhtact.
set_PersonalInfoSpecify other additional contact information
set_PhotoContains contact photo MapiContactPhoto .
set_PhysicalAddressesSpecify three physical addresses: Home Address, Work Address, and Other Address. One of the addresses can be marked as the Mailing Address
set_PidTagUrlNameUses to specify the server URI of the contact WebDav only
set_ProfessionalInfoProperties are used to store professional details for the person represented by the contact
set_TelephonesSpecify telephone numbers for the contact
SetBodyContentSets the content of the body.
ContactClassRepresents message class.