2

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.

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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"
0

I tried to login microsoft account that provided on code using browser. Then it logged in. After that I closed. Then again checked python code for accessing mailbox using exchangelib. It worked. I think it taking any session or something. Before that it gives error like exchangelib.errors.UnauthorizedError: Invalid credentials for https://outlook.com/autodiscover/autodiscover.svc

2 Comments

This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.