title: Exchange Web Services: More Complex SearchFilters
body: <p>In a previous project where I used EWS, my search criteria was much simpler: find emails with "xxx" in the Subject.</p>
  
  <p>I'm now building this code into a more multi-purpose application; I will be monitoring various mailboxes for various criteria, for example:</p>
  
  <p><code>Find all mail items where the recipient is "email@example.com", AND subject contains "xxx" AND (body contains "yyy" OR body contains "zzz")</code></p>
  
  <p>However, using a SearchFilterCollection, although I can add multiple SearchFilters, I don't see how to apply different logical operators... there seems to be one logical operator per SearchFilterCollection:</p>
  
  <p><code>SearchFilterCollection sfc = new SearchFilterCollection(LogicalOperator.Or,                        new SearchFilter.ContainsSubstring(ItemSchema.Subject, "Test"));</code></p>
  
  <p>I suppose one solution would be to find a superset of the desired mail items, and then filter them more accurately later, when they are being processed. But I was wondering if there is a better way of filtering at the start, using SearchFilters or any other means?</p>