Reputation: 217
So, I'm using standard Python smtplib to send emails from a friend's AOL account (by their request). I'm using an app password, and I'm connecting with s = smtplib.SMTP_SSL('smtp.aol.com')
. However, when I try to connect with the username and the app password (not being shared for obvious reasons) using s.login(email, pwd)
, I receive a "connection unexpectedly closed" error. When I increased the debug level, I discovered that the error was "too many bad auth attempts." Some searching indicated that I should just specify I'm using port 587, but no dice - that just gives me a different error indicating I'm using the "wrong version number," whatever that means. I've used this same code to send emails through my own Gmail account without issue, so clearly it's something specific to AOL, and I've verified that the app password and the email address are correct. Can someone help me understand what I'm doing wrong? Here's the relevant code block, such as it is:
s = smtplib.SMTP_SSL('smtp.aol.com')
s.set_debuglevel(1)
s.login(email, pwd) # <- fails on this line
s.connect
Upvotes: 0
Views: 39