Add and Remove Members in MS Exchange Distribution Lists in C#

Add and Remove Members from MS Exchange Distribution Lists in C#

While working with MS Exchange Server from within .NET applications, you may need to work with distribution lists. In the previous post, you have seen how to create and fetch Exchange distribution lists. In this article, you will learn how to add or remove members in MS Exchange distribution lists programmatically in C# .NET.

.NET 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 .NET. It is a well-known API to create email client applications and work with MS Exchange Server. You can either download the API’s DLL or install it from NuGet using the following command.

PM> Install-Package Aspose.Email

Add Members to MS Exchange Distribution Lists in C#

The following are the steps to add members to MS Exchange distribution list in C# .NET.

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

Remove Members from MS Exchange Distribution Lists in C#

The following are the steps to remove members from MS Exchange distribution list using C# .NET.

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

Get a Free API License

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

Conclusion

In this article, you have learned how to manage members in distribution lists on Microsoft Exchange Server. Particularly, you have seen how to add or remove members from Exchange distribution lists programmatically in C#. Alongside, you can explore the documentation to read more about Aspose.Email for .NET. Also, you can ask your questions via our forum.

See Also