Hi! I was getting an AUTH error, but I took y'alls advice and used "smtp.gmail.com", 465 for my mail server. It is now giving me this error:
File "/usr/lib/python3.8/smtplib.py", line 398, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed
Here is my flask code:
user = "myemail@mydomain.com"
password = "mypassword"
mailserver=smtplib.SMTP("smtp.gmail.com", 465)
mailserver.ehlo()
mailserver.starttls()
mailserver.login(user,password)
message = "Name:{}\nEmail: {}\nAddress: {}\nSize: {}\nNote: {}\nOrder: {}".format(name, email, address, size, note, order)
mailserver.sendmail(user,"email@mydomain.com",message)
I have a developer account, so I'm not sure why this isn't working. Any help would be greatly appreciated. Thanks!