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

Office 365 Mailbox programatic access fails: The Autodiscover service couldn't be located.

$
0
0

Not sure if this is the correct place but here goes:

I have been given a mailbox and I have written a windows service to look into the mailbox and process email messages.

The mailbox is of the form: createlead@api.mydomain.com

I log in to office365 with this email address and the password and I can see the mailbox just fine.

I try to connect with code:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);

Service.Credentials = new WebCredentials(username, password); //username as quoted above.

I get the following error:

Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException: The Autodiscover service couldn't be located.
   at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetLegacyUserSettings[TSettings](String emailAddress, List`1 redirectionEmailAddresses, Int32& currentHop)
   at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetLegacyUserSettings[TSettings](String emailAddress)
   at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetLegacyUserSettings(String emailAddress, List`1 requestedSettings)
   at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(String userSmtpAddress, UserSettingName[] userSettingNames)
   at Microsoft.Exchange.WebServices.Data.ExchangeService.GetAutodiscoverUrl(String emailAddress, ExchangeVersion requestedServerVersion, AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback)
   at Microsoft.Exchange.WebServices.Data.ExchangeService.AutodiscoverUrl(String emailAddress, AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback)
   at LeadProcessor.Library.MailboxHelper.GetBinding(String Username, String Password) in C:\...\LeadProcessor\LeadProcessor.Library\MailboxHelper.cs:line 472
   at LeadProcessor.Library.MailboxHelper.GetEmailHelper(String Username, String Password) in C:\...\LeadProcessor\LeadProcessor.Library\MailboxHelper.cs:line 491
   at LeadProcessor.WindowsService.Service1.ProcessMailbox(Organisation Config)

I have tried the Remote Connectivity Analyser but can't work out which option I should be choosing (Office 365 General Tests? Single Sign On?)

Tried this and got error: The domain  isn't a federated domain.

Not sure if this is saying I am using the wrong option in the Remote Connectivity Analyser or if there is something wrong with the mailbox.

Can anyone help?


Viewing all articles
Browse latest Browse all 7132

Trending Articles



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