Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Microsoft Exchange Example : Autodiscover not found

$
0
0

Hi all,

I need to send some emails generated with C# code, by using EWS (exchange web service).

Microsoft gives this example of code, but it doesn't work on my side; and the code doesn't contain any host and no domain for the Exchange 2010 server (my C# code is not in the same domain than the Exchange server).

The Microsoft example crashes saying "The Autodiscover service coundn't be located"


if (userData.AutodiscoverUrl == null)
{
   service.AutodiscoverUrl(userData.EmailAddress,  
RedirectionUrlValidationCallback); => Exception : "The Autodiscover service couldn't be located."
   userData.AutodiscoverUrl = service.Url;
}
else
{
   service.Url = userData.AutodiscoverUrl;
}

private static bool RedirectionUrlValidationCallback(string redirectionUrl)
{
  bool result = false;
  Uri redirectionUri = new Uri(redirectionUrl);
  if (redirectionUri.Scheme == "https")
  {
    result = true;
  }
  return result;
}

Eric



Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>