There's no such thing as IMAP4_SSl, but there is IMAP4_SSL. You have a lowercase l instead of an uppercase L. Python is case-sensitive. Notice how in the documentation, the name is all uppercase:
IMAP4_SSl
IMAP4_SSL
l
L
https://docs.python.org/3/library/imaplib.html#imaplib.IMAP4_SSL
2.1m questions
2.1m answers
60 comments
57.0k users