title: How to connect to ExchangeServer from ASP.net (using c#)?
body: <p>This is the code I use to connect to ExchangeServer. My account has 2 mailboxes assigned to it. Could this be the problem? I don't get any bug nor some result. Can someone help me, please?</p>
  
  <pre><code>static void Main(string[] args)
  {
      ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
  
      service.Credentials = new NetworkCredential( "{Active Directory ID}", "{Password}", "{Domain Name}" );
  
  
      service.AutodiscoverUrl("user@domain.com");
  
      FindItemsResults&lt;Item&gt; findResults = service.FindItems(
                  WellKnownFolderName.Inbox,
                  new ItemView(10));
  
      foreach (Item item in findResults.Items)
          Console.WriteLine(item.Subject);
  }
  </code></pre>