Я пытаюсь отправить электронное письмо с flask -mail и получаю эту ошибку.
Мой код:
@app.route('/', methods=["GET", "POST"])
def index():
if request.method == "GET":
msg = Message("Hey there", sender='mymail@gmail.com', recipients=['sometemporaryemail@emailhost99.com'])
mail.send(msg)
return render_template("index.html")
И это мои конфигурации:
app.config["DEBUG"] = True
app.config["MAIL_SERVER"] = "smtp.gmail.com"
app.config["MAIL_PORT"] = 465
app.config["TESTING"] = False
app.config["MAIL_USE_TLS"] = False
app.config["MAIL_USE_SSL"] = True
app.config["MAIL_USERNAME"] = 'mymail@gmail.com'
app.config["MAIL_PASSWORD"] = 'my password'
app.config["MAIL_DEFAULT_SENDER"] = 'mymail@gmail.com'
app.config["MAIL_MAX_EMAILS"] = None
app.config["MAIL_SUPRESS_SEND"] = False
app.config["MAIL_ASCII_ATTACHMENTS"] = False
mail = Mail(app)