2
votes

I have a C# program that connects to my Exchange Server 2010 and is able to read every email.

I am using the microsoft.exchange.webservices.dll library.

The problem is, that this program gives back the following exception on Exchange Server 2013: "The remote server returned an error: (501) Not Implemented."

I have no idea what's the difference between these 2 servers.

Edit: Some Code Snippets:

ExchangeVersion version = ExchangeVersion.Exchange2013; ExchangeService service = new ExchangeService(version); service.Credentials = new NetworkCredential("user", "pw", "domain"); service.AutodiscoverUrl("emailaddr");

and here happens the exception:

SearchFilter sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));

FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, sf, new ItemView(20));

service.LoadPropertiesForItems(findResults.Items, PropertySet.FirstClassProperties);

string mailsender = item.LastModifiedName;

1
Please show us the code you are using where the error is. It's possible that your code is only targeting Exchange Server 2010Our Man in Bananas
I have edited your title. Please see, "Should questions include “tags” in their titles?", where the consensus is "no, they should not".John Saunders
@JohnSaunders: I was wondering also about the Exchange Server but decided to leave it and missed entirely the c#Our Man in Bananas
@OurManInBananas: I felt that "Exchange Server 2013" was an adjective phrase qualifying "Email Driver". Q: "What kind of email driver?" A: "Exchange Server 2013 Email Driver".John Saunders
Probably a mismatch between server and EWS assembly version, is it the latest one from NuGet? Does it have an SP1 option in the ExchangeVersion enum?Charleh

1 Answers

0
votes

Finally found the problem:

There was a load balancer between exchange server and my server. I'm bridging this load balancer now -> Works perfectly