Manage Exchange Conversations via EWS

Aspose.Email allows you to manage conversation items on Microsoft Exchange Server using the EWSClient class. This functionality relies on Exchange Web Services (EWS), available in Exchange Server 2007 and later. The examples in this guide demonstrate how to find, copy, move, and delete conversation items on Exchange Server 2010 SP1 or later.

Find Conversations

To retrieve conversation information from a specific Exchange folder, follow the steps below:

  1. Connect to the Exchange Server using IEWSClient.
  2. Call FindConversations() method to list conversations in the target folder.
  3. Read properties such as conversation ID, topic, and flag status.

The following code sample demonstrates how to find and display conversation items from an Exchange Server inbox.

Copy Conversations

To copy conversation items to another folder:

  1. Connect to the Exchange Server using IEWSClient.
  2. Retrieve conversations with the FindConversations() method.
  3. Use CopyConversationItems() to copy matching conversations.

The following code sample demonstrates how to find and copy specific conversation items from an Exchange Server inbox to the Deleted Items folder based on the specified condition.

Move Conversations

You can move conversations between folders. The following code sample demonstrates how to find and move specific conversation items from an Exchange Server inbox to another folder.

  1. Connect to the Exchange Server using IEWSClient.
  2. Identify the conversations to move.
  3. Call the MoveConversationItems() method with the destination folder URI.

Delete Conversations

To delete conversation threads from a folder:

  1. Connect to the Exchange Server using IEWSClient.
  2. Use FindConversations() to locate the target conversations.
  3. Call the DeleteConversationItems() method to remove them.

The following code sample demonstrates how to find and delete specific conversation items from an Exchange Server inbox.