I am trying to read emails from Exchange server using python,
but i'm always getting the error "All steps in the autodiscover protocol failed for email";
i already did it with C# and it's working fine (see the code below) But it's not working in python,
C# working fine
ExchangeService Service = new ExchangeService(ExchangeVersion.Exchange2013);
Service.TraceEnabled = true;
Service.Credentials = new WebCredentials("username", "password", "domaine");
Service.AutodiscoverUrl("username@domaine");
python not working
from exchangelib import Credentials, Account
credentials = Credentials("domaine\\username", "password")
account = Account("username@domaine", credentials=credentials, autodiscover=True)
for item in account.inbox.all().order_by('-datetime_received')[:100]:
print(item.subject, item.sender, item.datetime_received)