相关疑难解决方法(0)

如何设置Airflow发送电子邮件?

我按照在线教程在airflow.cfg中设置了Email SMTP服务器,如下所示:

[email]
email_backend = airflow.utils.email.send_email_smtp


[smtp]
# If you want airflow to send emails on retries, failure, and you want to use
# the airflow.utils.email.send_email_smtp function, you have to configure an
# smtp server here
smtp_host = smtp.gmail.com
smtp_starttls = True
smtp_ssl = False
# Uncomment and set the user/pass settings if you want to use SMTP AUTH 
# smtp_user =                       
# smtp_password =  
smtp_port = 587
smtp_mail_from = myemail@gmail.com
Run Code Online (Sandbox Code Playgroud)

我的DAG如下:

from datetime import datetime
from airflow import DAG …
Run Code Online (Sandbox Code Playgroud)

python smtp airflow

14
推荐指数
1
解决办法
1万
查看次数

标签 统计

airflow ×1

python ×1

smtp ×1