Fixed your code tag look at BBCode
Add this to see the actual smtp conversation before it raise error.
Add this to see the actual smtp conversation before it raise error.
server = smtplib.SMTP('smtp.gmail.com', 587) server.set_debuglevel(1) server.ehlo()