Email¶
Standalone send_email usable as Airflow’s [email] email_backend.
- airflow.providers.mailer.utils.email.send_email(to: list[str] | str, subject: str, html_content: str, files: list[str] | None = None, dryrun: bool = False, cc: list[str] | str | None = None, bcc: list[str] | str | None = None, mime_subtype: str = 'mixed', mime_charset: str = 'utf-8', conn_id: str | None = None, from_email: str | None = None, **kwargs) None¶
Airflow email backend using MailerHook.
Configure in airflow.cfg:
[email] email_backend = airflow.providers.mailer.utils.email.send_email email_conn_id = smtp_default # optional, this is the default
The
email_conn_idconfig key maps toconn_idand selects which Airflow connection supplies the credentials – the standard SMTP connection, amailer_graphconnection, or amailer_smtp_oauthconnection.