2
votes

Given that my iPhone seems to be able to connect to Google Apps mail (ie: gmail, but with my own domain name) and use the calendar and contacts, I presumed that I'd be able to connect programmatically with Exchange Web Services. I assume the iPhone just treats gmail like an Exchange server, but the presence of the Google Apps Sync when using Outlook on the desktop to connect to gmail makes me wonder.

The short version of my question is: can I use EWS to connect to gmail and access my contacts and calendars (as well as email)?

My very first test of this assumption fails with it unable to autodiscover the configuration:

        ExchangeService service = new ExchangeService();
        service.AutodiscoverUrl("[email protected]");

        EmailMessage message = new EmailMessage(service);
        message.Subject = "Subject";
        message.Body = "Body";
        message.ToRecipients.Add("[email protected]");
        message.Save();

        message.SendAndSaveCopy();

My goal is to support a broader set of email beyond IMAP, and was hoping that EWS would extend my reach not just to Exchange servers but to gmail as well.

Thanks! Dave

2
This was asked a while ago, did you ever make any progress on it?jamesmillerio

2 Answers

1
votes

Gmail implements ActiveSync API, not EWS.

0
votes

Exchange Web Services is built specifically for Exchange server by Microsoft. It is not a "standard" for mail services and I doubt that Google is using Exchange Server for GMail. GMail probably has its own web service API that iPhone is using. By the way, iPhone can also connect to Exchange Server in which case it may be using EWS or WebDAV.