SMTP AUTH extension not supported by server. i know that this has something to do with smtplib not working for authentication, so how do i fix this? i get that error when i run this code;
import smtplib, ssl
def sendEmail(message):
smtp_server = "smtp.gmail.com"
port = 587
sender_email = "[email protected]"
password = "password"
receiver_email = "[email protected]"
try:
server = smtplib.SMTP(smtp_server, port)
server.ehlo()
server.login(sender_email, password)
server.sendmail(sender_email, receiver_email, message)
except Exception as e:
print(e)
finally:
server = smtplib.SMTP(smtp_server, port)
server.quit()
sendEmail("hello there")