title: Sending email via Exchange WebServices Java API 1.1
body: <p>Other operations such as creating folders, retrieving information about the existing folders, items seem to work but sending email to a valid email address doesnt work. What could be wrong with the following code is doing so? I appreciate your help.</p>
  
  <pre><code>    ExchangeService service = new ExchangeService();
      ExchangeCredentials credentials = new WebCredentials("vuser","vpass");
      service.setCredentials(credentials);    
      service.setUrl(new URI("https://valid_server/ews/Exchange.asmx"));      
  
  
      EmailMessage msg= new EmailMessage(service);
      msg.setSubject("Hello world!"); 
      msg.setBody(MessageBody.getMessageBodyFromText("Sent using the EWS Managed API."));
      msg.getToRecipients().add("valid@hotmail.com");
      msg.sendAndSaveCopy();
  
  System.out.println("done");
  </code></pre>