title: EWS Managed API - Ignore Meeting Requests
body: <p>Using EWS API to retrieve unread messages from mailbox using code below.  It is retrieving meeting requests (or invites) also.  Is there a way to ignore these type of emails?  </p>
  
  <pre><code>//search filter to get unread email
  var searchFilter = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));
  
  //count of unread emails to retrieve
  var view = new ItemView(50) { PropertySet = new PropertySet(PropertySet.IdOnly) };
  
  //properties to return in the result set
  var propertySet = new PropertySet {
      ItemSchema.Subject,
      ItemSchema.Body,
      ItemSchema.HasAttachments,
      ItemSchema.DateTimeReceived };
  
  //order the search results by the DateTimeReceived in asc order
  view.OrderBy.Add(ItemSchema.DateTimeReceived, SortDirection.Ascending);
  
  //set the traversal to shallow - shallow is the default option other options are Associated and SoftDeleted
  FindItemsResults&lt;Item&gt; findResults;
  
  do {
      //get emails from Inbox using search filter, view and retrieve properties defined above
      findResults = exchangeService.FindItems(WellKnownFolderName.Inbox, searchFilter, view);
      if (findResults.Items.Count &gt; 0)
      {
          //do stuff
      }
      view.Offset += findResults.Items.Count;
  } while (findResults.MoreAvailable);
  </code></pre>