title: C# EWS Managed API: How to access shared mailboxes but not my own inbox
body: <p>How can I connect to an exchange server and read mail from a shared mailbox (one that is not my own "myname@mycompany.com").</p>
  
  <p>Here is my code thus far:</p>
  
  <pre><code>//Create a service
          ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
          //Autodiscover end point
          service.AutodiscoverUrl("someaddress@mycompany.com");
  
  
          FindFoldersResults folderSearchResults = service.FindFolders(WellKnownFolderName.Inbox, new FolderView(int.MaxValue));
  
          Microsoft.Exchange.WebServices.Data.Folder exchangeMailbox = folderSearchResults.Folders.ToList().Find(
              f =&gt; f.DisplayName.Equals("NameOfSharedMailboxIwant", StringComparison.CurrentCultureIgnoreCase));
  
          //Set the number of items we can deal with at anyone time.
          ItemView itemView = new ItemView(int.MaxValue);
  
          foreach (Microsoft.Exchange.WebServices.Data.Folder folderFromSearchResults in folderSearchResults.Folders)
          {
              if (folderFromSearchResults.DisplayName.Equals("NameOfSharedMailboxIWant", StringComparison.OrdinalIgnoreCase))
              {
                  Microsoft.Exchange.WebServices.Data.Folder boundFolder = 
                          Microsoft.Exchange.WebServices.Data.Folder.Bind(service, folderFromSearchResults.Id);
  
                  SearchFilter unreadSearchFilter =
                      new SearchFilter.SearchFilterCollection(
                          LogicalOperator.And, new SearchFilter.IsEqualTo(
                              EmailMessageSchema.IsRead, false));
  
                  //Find the unread messages in the email folder.
                  FindItemsResults&lt;Item&gt; unreadMessages = boundFolder.FindItems(unreadSearchFilter, itemView);
  
                  foreach (EmailMessage message in unreadMessages)
                  {
                      message.Load();
  
                     Console.WriteLine(message.Subject);
  
  
                 }    
                  }
  </code></pre>
  
  <p>When I run this, I get an exception thrown that says that that "The SMTP address has no mailbox associated with it " during:</p>
  
  <pre><code> Microsoft.Exchange.WebServices.Data.Folder exchangeMailbox = folderSearchResults.Folders.ToList().Find(
              f =&gt; f.DisplayName.Equals("BA", StringComparison.CurrentCultureIgnoreCase));
  </code></pre>
  
  <p>What am I missing? I feel like I am almost there and that this should work according to the EWS Managed API 2.0 documentation, but I</p>