Get Contacts List from Microsoft Exchange Server in Java

While working with Microsoft Exchange Server programmatically, you may need to access the contacts from it. For example, to export the contacts, manipulate them, or use them for other purposes. In this article, you will learn how to get the contacts list from Microsoft Exchange Server in Java.

Java API to Get Contacts List from MS Exchange Server

To retrieve the contacts, we will use Aspose.Email for Java. The API is designed to implement the email clients from within the Java applications. It also lets you connect to MS Exchange Server and perform various operations programmatically. You can either download the API’s JAR or install it from Maven using the following Maven configurations.

Repository:

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>http://repository.aspose.com/repo/</url>
</repository>

Dependency:

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-email</artifactId>
    <version>22.2</version>
    <classifier>jdk16</classifier>
</dependency>

Retrieve Contacts List from MS Exchange Server in Java

The following are the steps to get the contacts list from Microsoft Exchange Server in Java.

The following code sample shows how to retrieve the contacts from Microsoft Exchange Server.

Get a Contact from MS Exchange Server by ID

You can also retrieve a contact from MS Exchange Server using its ID. The following are the steps to perform this operation.

The following code sample shows how to retrieve a particular contact from Microsoft Exchange Server in Java.

Get a Free API License

Get a free temporary license and use Aspose.Email for Java without evaluation limitations.

Conclusion

In this article, you have learned how to get the contacts list from Microsoft Exchange Server in Java. Furthermore, you have seen how to retrieve a contact by its ID programmatically. In addition to that, you can read more about Aspose.Email for Java using the documentation. Also, in case you would have any questions, you can post to our forum.

See Also