public static void Run() { const string mailboxUri = "https://exchange/ews/exchange.asmx"; const string domain = @""; const string username = @"*****@*****.**"; const string password = @"password"; NetworkCredential credentials = new NetworkCredential(username, password, domain); // ExStart:FindConversationsOnExchangeServer IEWSClient client = EWSClient.GetEWSClient(mailboxUri, credentials); Console.WriteLine("Connected to Exchange 2010"); // Find Conversation Items in the Inbox folder ExchangeConversation[] conversations = client.FindConversations(client.MailboxInfo.InboxUri); // Show all conversations foreach (ExchangeConversation conversation in conversations) { // Display conversation properties like Id and Topic Console.WriteLine("Topic: " + conversation.ConversationTopic); Console.WriteLine("Flag Status: " + conversation.FlagStatus.ToString()); Console.WriteLine(); } // ExEnd:FindConversationsOnExchangeServer }
public static void Run() { const string mailboxUri = "https://exchange/ews/exchange.asmx"; const string domain = @""; const string username = @"*****@*****.**"; const string password = @"password"; NetworkCredential credentials = new NetworkCredential(username, password, domain); IEWSClient client = EWSClient.GetEWSClient(mailboxUri, credentials); Console.WriteLine("Connected to Exchange 2010"); // ExStart:CopyConversations // Find those Conversation Items in the Inbox folder which we want to copy ExchangeConversation[] conversations = client.FindConversations(client.MailboxInfo.InboxUri); foreach (ExchangeConversation conversation in conversations) { Console.WriteLine("Topic: " + conversation.ConversationTopic); // Copy the conversation item based on some condition if (conversation.ConversationTopic.Contains("test email") == true) { client.CopyConversationItems(conversation.ConversationId, client.MailboxInfo.DeletedItemsUri); Console.WriteLine("Copied the conversation item to another folder"); } } // ExEnd:CopyConversations }