Add and Remove Members in MS Exchange Distribution Lists in Java

MS Exchange Server allows you to create distribution lists to send emails to a group of people. In the previous article, we have covered how to create or fetch Exchange distribution lists in Java. In this article, you will learn how to add or remove members in MS Exchange distribution lists in Java.

Java API to Manage Members of Exchange Distribution Lists

To work with members of distribution lists on MS Exchange Server, we will use Aspose.Email for Java. It is a powerful API that allows you to work with MS Exchange Server seamlessly. You can either download the API or install it 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.3</version>
    <classifier>jdk16</classifier>
</dependency>

Add Members to MS Exchange Distribution Lists in Java

The following are the steps to add members to MS Exchange distribution list in Java.

The following code sample shows how to add members to an Exchange distribution list in Java.

Remove Members from MS Exchange Distribution Lists in Java

The following are the steps to remove members from MS Exchange distribution list using Java.

The following code sample shows how to delete members from Exchange distribution lists in Java.

Get a Free API License

You can get a free temporary license to use Aspose.Email for Java without evaluation limitations.

Conclusion

In this article, we have covered how to manipulate members in MS Exchange distribution lists programmatically. With the help of code samples, you have seen how to add or remove members from an Exchange distribution list in Java. Alongside, you can explore the documentation to read more about Aspose.Email for Java. Also, you can ask your questions via our forum.

See Also