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 MapiContactNamePropertySet getNameInfo()

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

      • setNameInfo

        public void setNameInfo(MapiContactNamePropertySet value)

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

      • getProfessionalInfo

        public MapiContactProfessionalPropertySet getProfessionalInfo()

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

      • setProfessionalInfo

        public void setProfessionalInfo(MapiContactProfessionalPropertySet value)

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

      • setElectronicAddresses

        public void setElectronicAddresses(MapiContactElectronicAddressPropertySet value)

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

      • getPhysicalAddresses

        public 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 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

      • getPhoto

        public MapiContactPhoto getPhoto()

        Contains contact photoMapiContactPhoto.

      • setPhoto

        public void setPhoto(MapiContactPhoto value)

        Contains contact photoMapiContactPhoto.

      • 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 MapiMessage getUnderlyingMessage()

        Get the MapiMessage that represent contact.

        Returns:
        The MapiMessage object.
      • save

        public 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 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 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 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 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 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