com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Class MapiContact

  • All Implemented Interfaces:
    IMapiMessageItem, com.aspose.ms.System.IDisposable


    public final class MapiContact
    extends MapiMessageItemBase

    Represents outlook contact information

    • Constructor Detail

      • MapiContact

        public MapiContact()

        Initializes a new instance of the MapiContact class

      • MapiContact

        public MapiContact(String displayName,
                   String electonicAddress)

        Initializes a new instance of the MapiContact class.

        Parameters:
        displayName - The display name.
        electonicAddress - The electonic address.
      • MapiContact

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

        Initializes a new instance of the MapiContact class.

        Parameters:
        displayName - The display name.
        electonicAddress - The electonic address.
        companyName - Name of the company.
      • MapiContact

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

        Initializes a new instance of the MapiContact class.

        Parameters:
        displayName - The display name.
        electonicAddress - The electonic address.
        companyName - Name of the company.
        primaryTelephoneNumber - The telephone number.
    • Method Detail

      • getNameInfo

        public final MapiContactNamePropertySet getNameInfo()

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

      • setNameInfo

        public final void setNameInfo(MapiContactNamePropertySet value)

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

      • getProfessionalInfo

        public final MapiContactProfessionalPropertySet getProfessionalInfo()

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

      • setProfessionalInfo

        public final void setProfessionalInfo(MapiContactProfessionalPropertySet value)

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

      • getElectronicAddresses

        public final MapiContactElectronicAddressPropertySet getElectronicAddresses()

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

      • setElectronicAddresses

        public final void setElectronicAddresses(MapiContactElectronicAddressPropertySet value)

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

      • 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

      • setPhysicalAddresses

        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

      • fromVCard

        public static MapiContact fromVCard(String filePath)

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

        Parameters:
        filePath - A file name to read from
        Returns:
        A read MapiContact
        Throws:
        com.aspose.ms.System.ArgumentException - filePath is null or empty
      • fromVCard

        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:
        filePath - A file name to read from
        encoding - File data encoding
        Returns:
        A read MapiContact
        Throws:
        com.aspose.ms.System.ArgumentException - filePath is null or empty
      • fromVCard

        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:
        stream - A stream to read from
        Returns:
        A read MapiContact
        Throws:
        com.aspose.ms.System.ArgumentNullException - stream is null
        com.aspose.ms.System.NotSupportedException - stream does not support reading
      • fromVCard

        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:
        stream - A stream to read from
        encoding - Stream data encoding
        Returns:
        A read MapiContact
        Throws:
        com.aspose.ms.System.ArgumentNullException - stream is null
        com.aspose.ms.System.NotSupportedException - stream does not support reading
      • getUnderlyingMessage

        public final MapiMessage getUnderlyingMessage()

        Get the MapiMessage that represent contact.

        Returns:
        The MapiMessage object.
      • save

        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:
        filePath - A vCard file name
        Throws:
        com.aspose.ms.System.ArgumentException - filePath is null or empty
      • save

        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:
        filePath - A vCard file name
        saveFormat - A save format
        Throws:
        com.aspose.ms.System.ArgumentException - filePath is null or empty
        com.aspose.ms.System.NotSupportedException - the specified format is not supported
      • save

        public final void save(String filePath,
                ContactSaveOptions saveOptions)

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

        Parameters:
        filePath - A vCard file name
        saveOptions - A save options
        Throws:
        com.aspose.ms.System.ArgumentException - filePath is null or empty
        com.aspose.ms.System.ArgumentNullException - saveOptions is null
        com.aspose.ms.System.NotSupportedException - some save option is not supported
      • save

        public final void save(OutputStream stream)

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

        Parameters:
        stream - A stream to save to
        Throws:
        com.aspose.ms.System.ArgumentNullException - stream is null
        com.aspose.ms.System.NotSupportedException - stream does not support writing
      • save

        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:
        stream - A stream to save to
        saveFormat - A save format
        Throws:
        com.aspose.ms.System.ArgumentNullException - stream is null
        com.aspose.ms.System.NotSupportedException - stream does not support writing
        com.aspose.ms.System.NotSupportedException - The specified format is not supported
      • save

        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:
        stream - A stream to save to
        saveOptions - A save options
        Throws:
        com.aspose.ms.System.ArgumentNullException - stream or saveOptions is null
        com.aspose.ms.System.NotSupportedException - stream does not support writing
        com.aspose.ms.System.ArgumentException - incorrect saveOptions
        com.aspose.ms.System.NotSupportedException - some save option is not supported
      • setBodyContent

        public void setBodyContent(String content,
                          int contentType)

        Sets the content of the body.

        Overrides:
        setBodyContent in class MapiMessageItemBase
        Parameters:
        content - The content.
        contentType - 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.
        Throws:
        com.aspose.ms.System.ArgumentNullException - throws if the specified content string is null or empty.