title: Exchange Web Services API : get mail attachments
body: <p>I am using the EWS API 1.2 to access mailboxes on our Exchange Server.
  This just works fine but there is one thing I cannot achieve : get mail attachments.</p>
  
  <p>Im wrote the following lines : </p>
  
  <pre><code>class Program
  {
      public static void Main(string[] args)
      {
          try {
              ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
              service.Credentials = new WebCredentials("login","password");
              service.AutodiscoverUrl("mail@domaine.fr");
  
              ItemView view = new ItemView(10);
              FindItemsResults&lt;Item&gt; findResults = service.FindItems(WellKnownFolderName.Inbox, new ItemView(10));
  
              if (findResults != null &amp;&amp; findResults.Items != null &amp;&amp; findResults.Items.Count &gt; 0)
                  foreach (Item item in findResults.Items)
                  {
                      if (item.Attachments != null)
                      {
                          IEnumerator&lt;Attachment&gt; e = item.Attachments.GetEnumerator();
                      }   
                      Console.WriteLine(item.Subject);
                  }
              else
                  Console.WriteLine("no items");
          } 
          catch (Exception e) {
              Console.WriteLine(e.Message);
          }
          Console.ReadLine();
      }
  }
  </code></pre>
  
  <p>I get all mails in the tested mailbox but <code>IEnumerator&lt;Attachment&gt; e = item.Attachments.GetEnumerator();</code> seems not to "see" attachments.</p>
  
  <p>Have you got any idea of what I missed ?</p>
  
  <p>Thanks a lot.</p>