Kurt
Kurt

Reputation: 1897

Problems using the EWS API on mixed Exchange versions

I have an app using the EWS API. Some computers using Exchange 2003 and some use 2007/2010. Initially, in my app I just used:

ExchangeService service = new ExchangeService();
service.UseDefaultCredentials = true;
service.AutodiscoverUrl(url);

But I found out quickly that that fails on the computers using 2003, with the error: "Client mailboxes must be on Exchange Server 2010 or later". So I changed my code to (obviously removed the actual address to the Exchange server):

ExchangeService service = new ExchangeService();
service.UseDefaultCredentials = true;
service.Url = new Uri("https://.....");

Now I get the error: "The mailbox that was requested doesn't support the specified RequestServerVersion.".

So, I think I understand why this is happening and really just seems like I have to do something completely different to get this working on 2003. Except short of using the Net.Mail api instead, I'm not sure exactly how to do it. Can I still use the EWS API and if so, what do I need to change to allow it to work on both?

Upvotes: 2

Views: 1917

Answers (1)

IvanH
IvanH

Reputation: 5159

Exchange 2003(2000?) uses different API, which is completely different from EWS. Exchange 2007 supports both API.

You can use CDO How do I use CDO with Exchange with vbscript

or WebDAV Access Your Exchange 2000 / 2003 Mailbox With WebDAV.

Note
I think its better to use New ExchangeService(ExchangeVersion.Exchange2007_SP1), then you are sure that it is working with 2007 and use backward compatibility on 2010.

Upvotes: 1

Related Questions