import os
import smtplib, ssl
def send_mail(msg) :
host = "smtp.gmail.com"
port = 465
user_mail = "[email protected]"
password = os.getenv("News_Pass")
receiver = "[email protected]"
context = ssl.create_default_context()
with smtplib.SMTP_SSL(host=host,port=port,context=context) as server:
server.login(user_mail,password)
server.sendmail(user_mail,receiver,msg)
I want to send email using python code, but I get the following error: smtpDataError(550). What should I do?