title: I need to get emails with help of EWS in C#
body: <p>Here is my code:</p>
  
  <pre><code>using System;
  using System.Net;
  using MailListClient.MailListServiceReference;
  using Microsoft.Exchange.WebServices.Autodiscover;
  using Microsoft.Exchange.WebServices.Data;
  
  namespace MailListClient
  {
     class Program
     {
         static void Main(string[] args)
         {
             var service = GetBinding();
  
             ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) =&gt; true;
  
             try
             {
                 FindItemsResults&lt;Item&gt; findResults = service.FindItems(
                     WellKnownFolderName.Inbox,
                     new ItemView(10));
  
                 foreach (Item item in findResults.Items)
                     Console.WriteLine(item.Id);
             }
             catch (Exception ex)
             {
                 Console.WriteLine("Error: " + ex.Message);
                 Console.ReadLine();
             }
         }
  
         static ExchangeService GetBinding()
         {
             ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
             service.Credentials = new WebCredentials("zxzxzxzxzx@email.com", "password");
             try
             {
                 service.Url = new Uri("https://email.com/AutoDiscover/AutoDiscover.xml");
             }
             catch (AutodiscoverRemoteException ex)
             {
                 Console.WriteLine("Exception thrown: " + ex.Error.Message);
             }
             return service;
         }
     }
  }
  </code></pre>
  
  <p>But I get Exception: <strong>The request failed. The remote server returned an error: (404) Not Found.</strong>
  What is the problem?</p>