none
EWS email message question? RRS feed

Answers

  • Well, I don't use any of the managed APIs, but I know that EWS (i.e. the core API) can send to external addresses, because I've done it many times.  It would be rather useless if it couldn't :-).

    Does the message get saved in the Drafts folder?  Only successfully sent messages make it to Sent Items.  If something is failing, you may find it in Drafts.


    Outlook Web Access For PDA , OWA For WAP
    www.owa-pda.com
    email a@t leederbyshire d.0.t c.0.m
    Thursday, May 5, 2011 12:41 PM

All replies

  • If I understand your question correctly, then yes - you can use EWS to send an email from an Exchange mailbox account to a hotmail address.  Since you have already mentioned EWS, I assume you have E2007 or E2010 (only these versions of Exchange have EWS)?
    Outlook Web Access For PDA , OWA For WAP
    www.owa-pda.com
    email a@t leederbyshire d.0.t c.0.m
    Tuesday, May 3, 2011 1:58 PM
  • Thank you Lee for the answer.

    I am asking this question because other operations when using Java EWS api 1.1 such as creating folders, retrieving information about the existing folders, items seem to work but sending email to a valid email address(hotmail or gmail) doesnt work. What could be wrong with the following code is doing so? I appreciate your help

        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"); 

     

    Tuesday, May 3, 2011 7:33 PM
  • Does the email message get saved in the user's Sent Items folder?  It's possible that the message gets blocked by the Hotmail spam filter.  Getting messages delivered to Hotmail, Gmail, etc. email addresses is a common problem for developers, because they often don't like the source IP addresses (often they are from domestic a IP range), or the messages don't look genuine enough (i.e. just the word 'Test' as the subject, and not much interesting text).
    Outlook Web Access For PDA , OWA For WAP
    www.owa-pda.com
    email a@t leederbyshire d.0.t c.0.m
    Tuesday, May 3, 2011 10:29 PM
  • I executed the following code to determine whether the sent message got saved in the sent items folder but the total count of items in this folder returned 0.

    Folder sentitems = Folder.bind(service, WellKnownFolderName.

    SentItems);

    System.

    out.println(sentitems.getTotalCount());

    I checked in the spam folder of both gmail and hotmail but didnt find any emails that i sent from the exchange account using EWS.

    Also, I tried changing the subject and body of the message to more genuine messages like in subject "hi john" and in body "are your finals over yet?". But, i didnt receive any emails in hotmail and gmail.

    I am trying to figure out the solution to this problem for a long time. Do you know what is wrong? Is this a defect in the java ews api? Can you propose one solution to overcome this problem?

    I appreciate your help.

    Thanks

    Wednesday, May 4, 2011 6:46 PM
  • Well, I don't use any of the managed APIs, but I know that EWS (i.e. the core API) can send to external addresses, because I've done it many times.  It would be rather useless if it couldn't :-).

    Does the message get saved in the Drafts folder?  Only successfully sent messages make it to Sent Items.  If something is failing, you may find it in Drafts.


    Outlook Web Access For PDA , OWA For WAP
    www.owa-pda.com
    email a@t leederbyshire d.0.t c.0.m
    Thursday, May 5, 2011 12:41 PM
  • Thank you Lee for all your answers and help. I found out that the configuration set in the server didnt allow off campus emails to be sent or received in the given account. Now, the problem is solved.
    Thursday, May 5, 2011 9:53 PM