Quantcast
Channel: Exchange Server 2013 - General Discussion forum
Viewing all articles
Browse latest Browse all 13303

Getting error, when try to connect to the exchange server using c# code

$
0
0

Hi,

I have written the following code to login into the Exchange Server but I got the error "The Autodiscover service couldn't be
located"
                excusername = "UserName";
                excpassword = "Password";
                excdomain = "SomeDomain";
                excurl = "ConnectionURL";
                excemail = UserName@domain.com;

                ExchangeService _exch = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
                _exch.Credentials = new WebCredentials(excusername, excpassword, excdomain);
                _exch.Url = new System.Uri(@"http://" + excurl);
                _exch.AutodiscoverUrl(excemail);

When I execute this code, I got the exception in below  line

_exch.AutodiscoverUrl(excemail) ;

Stating as "The Autodiscover service couldn't be located". So, please tell us the solution as soon as possible.

Regards

Nishant


Viewing all articles
Browse latest Browse all 13303

Trending Articles



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