title: Microsoft.Exchange.WebServices.Data.ServiceResponseException: When Sending Emails
body: <p>I am using EWS Managed API to send email.
  I am getting a Microsoft.Exchange.WebServices.Data.ServiceResponseException: EmailAddress or ItemId must be included in the request.</p>
  
  <p>In the Soap return XML I see ErrorMissingInformationEmailAddress : This error occurs if the EmailAddress (NonEmptyStringType) element is missing.</p>
  
  <p>Which email address is it talking about?</p>
  
  <p>Using Exchange 2007 SP1.
  Exchange credentials are correct and the to/from email addresses are valid emails.
  Any ideas? Google has not helped.</p>
  
  <p>Same code has worked for other Exchange Servers.
  service.AutodiscoverUrl() does not work for this server. </p>
  
  <pre><code>using Microsoft.Exchange.WebServices.Data;
  
  protected void SendEwsMail()
      {
          //Trust all certificates
          System.Net.ServicePointManager.ServerCertificateValidationCallback =
              ((sender, certificate, chain, sslPolicyErrors) =&gt; true);
  
          var service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
          service.Credentials = new NetworkCredential("user@domain.com", "password");
          service.Url = new Uri("Url");
  
          var email = new EmailMessage(service);
  
          email.ToRecipients.Add("user@domain.com");
  
          email.From = new EmailAddress("user@domain.com");
          //email.ReplyTo.Add(recipient.FromAddress);
          email.Sender = new EmailAddress("user@domain.com");
  
          email.Subject = "test";
  
          // Send the message and save a copy.
          email.SendAndSaveCopy();
      }
  </code></pre>