MapiContact

Inheritance: java.lang.Object, com.aspose.email.MapiPropertyContainer, com.aspose.email.MapiMessageItemBase

public final class MapiContact extends MapiMessageItemBase

Represents outlook contact information

Constructors

Constructor Description
MapiContact() Initializes a new instance of the MapiContact class
MapiContact(String displayName, String electonicAddress) Initializes a new instance of the MapiContact class.
MapiContact(String displayName, String electonicAddress, String companyName) Initializes a new instance of the MapiContact class.
MapiContact(String displayName, String electonicAddress, String companyName, String primaryTelephoneNumber) Initializes a new instance of the MapiContact class.

Methods

Method Description
getItemId() Uses to specify the server id of the contact EWS only
getNameInfo() The properties are used to specify the name of the person represented by the contact
setNameInfo(MapiContactNamePropertySet value) The properties are used to specify the name of the person represented by the contact
getPersonalInfo() Specify other additional contact information
setPersonalInfo(MapiContactPersonalInfoPropertySet value) Specify other additional contact information
getProfessionalInfo() Properties are used to store professional details for the person represented by the contact
setProfessionalInfo(MapiContactProfessionalPropertySet value) Properties are used to store professional details for the person represented by the contact
getTelephones() Specify telephone numbers for the contact
setTelephones(MapiContactTelephonePropertySet value) Specify telephone numbers for the contact
getElectronicAddresses() Specify properties for up to three different e-mail addresses and three different fax addresses
setElectronicAddresses(MapiContactElectronicAddressPropertySet value) Specify properties for up to three different e-mail addresses and three different fax addresses
getPhysicalAddresses() Specify three physical addresses: Home Address, Work Address, and Other Address.
setPhysicalAddresses(MapiContactPhysicalAddressPropertySet value) Specify three physical addresses: Home Address, Work Address, and Other Address.
getEvents() Specify events associated with a contact
setEvents(MapiContactEventPropertySet value) Specify events associated with a contact
getOtherFields() Specify other fields of conhtact.
setOtherFields(MapiContactOtherPropertySet value) Specify other fields of conhtact.
getPhoto() Contains contact photoMapiContactPhoto.
setPhoto(MapiContactPhoto value) Contains contact photoMapiContactPhoto.
fromVCard(String filePath) Reads MapiContact from the specified vCard file The supported vCard versions are 2.1 and 3.0
fromVCard(String filePath, Charset encoding) Reads MapiContact from the specified vCard file The supported vCard versions are 2.1 and 3.0
fromVCard(InputStream stream) Reads MapiContact from the specified stream containing vCard.
fromVCard(InputStream stream, Charset encoding) Reads MapiContact from the specified stream containing vCard.
getUnderlyingMessage() Get the MapiMessage that represent contact.
save(String filePath) Saves this MapiContact to the vCard file with a default options.
save(String filePath, int saveFormat) Saves this MapiContact to the specified file with a format using the default options.
save(String filePath, ContactSaveOptions saveOptions) Saves this MapiContact into file using specified save options.
save(OutputStream stream) Saves this MapiContact into the given stream with vCard format.
save(OutputStream stream, int saveFormat) Saves this MapiContact to the given stream with a format using the default options.
save(OutputStream stream, ContactSaveOptions saveOptions) Saves this MapiContact to the given stream using specified save options.
setBodyContent(String content, int contentType) Sets the content of the body.

MapiContact()

public MapiContact()

Initializes a new instance of the MapiContact class

MapiContact(String displayName, String electonicAddress)

public MapiContact(String displayName, String electonicAddress)

Initializes a new instance of the MapiContact class.

Parameters:

Parameter Type Description
displayName java.lang.String The display name.
electonicAddress java.lang.String The electonic address.

MapiContact(String displayName, String electonicAddress, String companyName)

public MapiContact(String displayName, String electonicAddress, String companyName)

Initializes a new instance of the MapiContact class.

Parameters:

Parameter Type Description
displayName java.lang.String The display name.
electonicAddress java.lang.String The electonic address.
companyName java.lang.String Name of the company.

MapiContact(String displayName, String electonicAddress, String companyName, String primaryTelephoneNumber)

public MapiContact(String displayName, String electonicAddress, String companyName, String primaryTelephoneNumber)

Initializes a new instance of the MapiContact class.

Parameters:

Parameter Type Description
displayName java.lang.String The display name.
electonicAddress java.lang.String The electonic address.
companyName java.lang.String Name of the company.
primaryTelephoneNumber java.lang.String The telephone number.

getItemId()

public final String getItemId()

Uses to specify the server id of the contact EWS only

Returns: java.lang.String

getNameInfo()

public final MapiContactNamePropertySet getNameInfo()

The properties are used to specify the name of the person represented by the contact

Returns: MapiContactNamePropertySet

setNameInfo(MapiContactNamePropertySet value)

public final void setNameInfo(MapiContactNamePropertySet value)

The properties are used to specify the name of the person represented by the contact

Parameters:

Parameter Type Description
value MapiContactNamePropertySet

getPersonalInfo()

public final MapiContactPersonalInfoPropertySet getPersonalInfo()

Specify other additional contact information

Returns: MapiContactPersonalInfoPropertySet

setPersonalInfo(MapiContactPersonalInfoPropertySet value)

public final void setPersonalInfo(MapiContactPersonalInfoPropertySet value)

Specify other additional contact information

Parameters:

Parameter Type Description
value MapiContactPersonalInfoPropertySet

getProfessionalInfo()

public final MapiContactProfessionalPropertySet getProfessionalInfo()

Properties are used to store professional details for the person represented by the contact

Returns: MapiContactProfessionalPropertySet

setProfessionalInfo(MapiContactProfessionalPropertySet value)

public final void setProfessionalInfo(MapiContactProfessionalPropertySet value)

Properties are used to store professional details for the person represented by the contact

Parameters:

Parameter Type Description
value MapiContactProfessionalPropertySet

getTelephones()

public final MapiContactTelephonePropertySet getTelephones()

Specify telephone numbers for the contact

Returns: MapiContactTelephonePropertySet

setTelephones(MapiContactTelephonePropertySet value)

public final void setTelephones(MapiContactTelephonePropertySet value)

Specify telephone numbers for the contact

Parameters:

Parameter Type Description
value MapiContactTelephonePropertySet

getElectronicAddresses()

public final MapiContactElectronicAddressPropertySet getElectronicAddresses()

Specify properties for up to three different e-mail addresses and three different fax addresses

Returns: MapiContactElectronicAddressPropertySet

setElectronicAddresses(MapiContactElectronicAddressPropertySet value)

public final void setElectronicAddresses(MapiContactElectronicAddressPropertySet value)

Specify properties for up to three different e-mail addresses and three different fax addresses

Parameters:

Parameter Type Description
value MapiContactElectronicAddressPropertySet

getPhysicalAddresses()

public final MapiContactPhysicalAddressPropertySet getPhysicalAddresses()

Specify three physical addresses: Home Address, Work Address, and Other Address. One of the addresses can be marked as the Mailing Address

Returns: MapiContactPhysicalAddressPropertySet

setPhysicalAddresses(MapiContactPhysicalAddressPropertySet value)

public final void setPhysicalAddresses(MapiContactPhysicalAddressPropertySet value)

Specify three physical addresses: Home Address, Work Address, and Other Address. One of the addresses can be marked as the Mailing Address

Parameters:

Parameter Type Description
value MapiContactPhysicalAddressPropertySet

getEvents()

public final MapiContactEventPropertySet getEvents()

Specify events associated with a contact

Returns: MapiContactEventPropertySet

setEvents(MapiContactEventPropertySet value)

public final void setEvents(MapiContactEventPropertySet value)

Specify events associated with a contact

Parameters:

Parameter Type Description
value MapiContactEventPropertySet

getOtherFields()

public final MapiContactOtherPropertySet getOtherFields()

Specify other fields of conhtact.

Returns: MapiContactOtherPropertySet

setOtherFields(MapiContactOtherPropertySet value)

public final void setOtherFields(MapiContactOtherPropertySet value)

Specify other fields of conhtact.

Parameters:

Parameter Type Description
value MapiContactOtherPropertySet

getPhoto()

public final MapiContactPhoto getPhoto()

Contains contact photoMapiContactPhoto.

Returns: MapiContactPhoto

setPhoto(MapiContactPhoto value)

public final void setPhoto(MapiContactPhoto value)

Contains contact photoMapiContactPhoto.

Parameters:

Parameter Type Description
value MapiContactPhoto

fromVCard(String filePath)

public static MapiContact fromVCard(String filePath)

Reads MapiContact from the specified vCard file The supported vCard versions are 2.1 and 3.0

Parameters:

Parameter Type Description
filePath java.lang.String A file name to read from

Returns: MapiContact - A read MapiContact

fromVCard(String filePath, Charset encoding)

public static MapiContact fromVCard(String filePath, Charset encoding)

Reads MapiContact from the specified vCard file The supported vCard versions are 2.1 and 3.0

Parameters:

Parameter Type Description
filePath java.lang.String A file name to read from
encoding java.nio.charset.Charset File data encoding

Returns: MapiContact - A read MapiContact

fromVCard(InputStream stream)

public static MapiContact fromVCard(InputStream stream)

Reads MapiContact from the specified stream containing vCard. The supported vCard versions are 2.1 and 3.0

Parameters:

Parameter Type Description
stream java.io.InputStream A stream to read from

Returns: MapiContact - A read MapiContact

fromVCard(InputStream stream, Charset encoding)

public static MapiContact fromVCard(InputStream stream, Charset encoding)

Reads MapiContact from the specified stream containing vCard. The supported vCard versions are 2.1 and 3.0

Parameters:

Parameter Type Description
stream java.io.InputStream A stream to read from
encoding java.nio.charset.Charset Stream data encoding

Returns: MapiContact - A read MapiContact

getUnderlyingMessage()

public final MapiMessage getUnderlyingMessage()

Get the MapiMessage that represent contact.

Returns: MapiMessage - The MapiMessage object.

save(String filePath)

public final void save(String filePath)

Saves this MapiContact to the vCard file with a default options. The supported vCard version is 2.1

Parameters:

Parameter Type Description
filePath java.lang.String A vCard file name

save(String filePath, int saveFormat)

public final void save(String filePath, int saveFormat)

Saves this MapiContact to the specified file with a format using the default options. The supported save format is vCard.

Parameters:

Parameter Type Description
filePath java.lang.String A vCard file name
saveFormat int A save format

save(String filePath, ContactSaveOptions saveOptions)

public final void save(String filePath, ContactSaveOptions saveOptions)

Saves this MapiContact into file using specified save options. The supported save options is VCardSaveOptions

Parameters:

Parameter Type Description
filePath java.lang.String A vCard file name
saveOptions ContactSaveOptions A save options

save(OutputStream stream)

public final void save(OutputStream stream)

Saves this MapiContact into the given stream with vCard format. The supported vCard version is 2.1

Parameters:

Parameter Type Description
stream java.io.OutputStream A stream to save to

save(OutputStream stream, int saveFormat)

public final void save(OutputStream stream, int saveFormat)

Saves this MapiContact to the given stream with a format using the default options. The supported save format is vCard

Parameters:

Parameter Type Description
stream java.io.OutputStream A stream to save to
saveFormat int A save format

save(OutputStream stream, ContactSaveOptions saveOptions)

public final void save(OutputStream stream, ContactSaveOptions saveOptions)

Saves this MapiContact to the given stream using specified save options. The supported save options is VCardSaveOptions

Parameters:

Parameter Type Description
stream java.io.OutputStream A stream to save to
saveOptions ContactSaveOptions A save options

setBodyContent(String content, int contentType)

public void setBodyContent(String content, int contentType)

Sets the content of the body.

Parameters:

Parameter Type Description
content java.lang.String The content.
contentType int Type of the content.

It is provided for setting of the content of the body message in RTF, HTML or Plain Text formats. When setting a value, the values of PR_RTF_COMPRESSED, PR_RTF_DECOMPRESSES, PR_BODY properties are updated as well. Note, after the value in HTML format is set, BodyRtf property returns the value which is encoded within RTF. |