none
EWS Java Api 1.1 Basic question??? RRS feed

  • Question

  • Using EWS Java Api 1.1, I am trying to send message to an email address. When run, It shows no error and yet i donot receive any emails in the given email address. Do you know what is going wrong?

    I have imported all the required libraries, classes. I appreciate your help.

    The code is as follows:

    ExchangeService service =

    new ExchangeService();

    ExchangeCredentials credentials =

    new WebCredentials("abc","jjk");

    service.setCredentials(credentials);

     

    service.setUrl(

    new URI("https://servername/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(

    "recipient@gmail.com");

    msg.send();

     

     

    System.

    out.println("done");

     

     

     

    Monday, May 2, 2011 3:49 PM