Jaa


Finding related messages in a mailbox by using EWS in Exchange 2010

Find out how to find and manage related messages in a mailbox by using EWS in Exchange.

Last modified: July 01, 2013

Applies to: Exchange Server 2007 | Exchange Server 2010

In this article
Conversation-related objects and methods
Customizing your conversations
Additional resources

Related code snippets and sample apps
Exchange 2013: Find conversations in mailboxes programmatically
Exchange 2013: Apply actions to manage conversations in a mailbox programmatically

You can use conversations in versions of Exchange starting with Exchange Server 2007, including Exchange Online, to find and manage related messages in a mailbox. Conversations are based on the first message’s Message-ID header. All replies and related messages will relate to the original message’s Message-ID header by their References and In-Reply-To headers. For each message received in a mailbox, the following properties are set:

  • ConversationTopic – Contains a normalized form of the subject value that was set on the original message.

  • ConversationIndex – Represents the position of the item in the conversation.

Exchange applies the same ConversationTopic property value to replies to the first message and then updates the ConversationIndex property value to represent the message’s position relative to the original message. If the subject of the email thread changes, Exchange applies a new ConversationTopic property value and new ConversationIndex property values to the new conversation.

Depending of the version or versions of Exchange that you are targeting, different conversation-related features are available. The following table lists the conversation-related features and the versions of Exchange in which they are available.

EWS object

Description

Implemented in the EWS Managed API…

Applies to

ConversationIndex property

Specifies the position of an item in a conversation based on the date and time it is received. This is the same as the Thread-Index Internet message header.

You can access this property by using the FindItem Operation or the GetItem Operation.

Via the EmailMessage.ConversationIndex and PostItem.ConversationIndex properties.

Use the Load() and Bind() methods to get these properties.

Versions of Exchange starting with Exchange 2007, including Exchange.

ConversationTopic property

Specifies the conversation topic. This is the same as the Thread-Topic Internet message header.

You can access this property by using the FindItem Operation or the GetItem Operation.

Via the EmailMessage.ConversationTopic and PostItem.ConversationTopic properties.

Use the Load() and Bind() methods to get these properties.

Versions of Exchange starting with Exchange 2007, including Exchange Online.

ConversationId property

Identifies a conversation thread.

Via the Item.ConversationId property.

Versions of Exchange starting with Exchange 2010, including Exchange Online.

FindConversation Operation

Searches for conversations and returns search results that contain the item identifiers of the items in the conversation along with the conversation’s metadata.

Via the ExchangeService.FindConversation() method.

Versions of Exchange starting with Exchange 2010, including Exchange Online.

ApplyConversationAction Operation

Identifies a conversation thread.

Via the Item.ConversationId property.

Versions of Exchange starting with Exchange 2010, including Exchange Online.

Customizing your conversations

You might want to find and display items in your Inbox based on something other than message subject. To do this, you can use custom extended properties. Design your data type and store it in an extended property. You can then query on that extended property to access items. You can also use extended properties to access the conversation properties that Exchange uses; however, we recommend that you use extended properties only to create your own order for email messages.