1

I have a python script that pulls attachments from Office 365 mailbox using exchangelib. It was working fine up until couple of days ago when I started to get an error:

Invalid credentials for https://outlook.office365.com/EWS/Exchange.asmx

I suspect this is a due to a updates that Microsoft did for Office 365. The credentials are correct and account has EWS enabled. I will appreciate any suggestions how to solve this.

goryef
  • 1,337
  • 3
  • 22
  • 37

1 Answers1

2

I believe Office365 finally switched off Basic Authentication. In that case, you need to use OAuth instead. See https://ecederstrand.github.io/exchangelib/#oauth-on-office-365 for a guide on doing that.

Erik Cederstrand
  • 9,643
  • 8
  • 39
  • 63
  • Thanks. I found your manual very helpful. I don't get a credential error anymore, but get this now "The SMTP address has no mailbox associated with it" – goryef Oct 14 '22 at 13:37