I have a simple python program as follows -
import imaplib
mail = imaplib.IMAP4_SSL('mail.o365.mailserver.com')
print mail.login('myuserid@domain.com', 'MyPassword')
print('Logged in')
I receive an error -
File "C:\Python27\lib\imaplib.py", line 520, in login
raise self.error(dat[-1])
error: LOGIN failed.
I found a link - http://bioportal.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/imaplib/index.html
However, this link stats that you get this error when the credentials are incorrect. EDIT - Please note that my credentials are correct.
Kindly note that the connection to my mailserver happens correctly and an instance is successfully received.
Can Anyone please comment on the issue.