Repository navigation
Deprecate airflow.utils.email in favor of the SMTP provider #75414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vatsrahul1001
merged 5 commits into
apache:main
from
shivaam:codex/email-core-deprecation
Oct 27, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a0fa74c
Deprecate airflow.utils.email in favor of the SMTP provider
shivaam 2f54260
Keep star imports of airflow.utils.email working and document the move
shivaam af796b4
Shorten the core email page and point to the SMTP provider docs
shivaam c628c17
Explain what changes for callers of the deprecated email functions
shivaam f327acd
Test that a plain script does not see a database-only SMTP Connection
shivaam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| ``airflow.utils.email`` is deprecated in favor of the SMTP provider | ||
|
|
||
| The functions in ``airflow.utils.email`` (``send_email``, ``send_email_smtp``, ``send_mime_email``, | ||
| ``build_mime_message`` and ``get_email_address_list``) now live in | ||
| ``airflow.providers.smtp.utils.emailer``. The old names still work and raise a ``DeprecatedImportWarning``. | ||
| Airflow now requires ``apache-airflow-providers-smtp>=3.2.0``. | ||
|
|
||
| Keep ``[email] email_backend`` set to ``airflow.utils.email.send_email_smtp``. Airflow treats that value as | ||
| "send task emails with ``SmtpNotifier``", which reads all SMTP settings from the Connection. Changing it to | ||
| the provider path sends through the ``[smtp]`` settings instead. | ||
|
|
||
| If you call these functions directly: | ||
|
|
||
| * The SMTP Connection is looked up with ``BaseHook.get_connection``. A script that runs outside Airflow's | ||
| processes needs the Connection in an environment variable or a secrets backend, not only in the metadata | ||
| database. | ||
| * Settings are read through the Task SDK configuration, so values changed at runtime with | ||
| ``airflow.configuration.conf.set()`` are not seen. ``airflow.cfg`` and environment variables work as before. | ||
| * Tests that patch ``airflow.utils.email.send_mime_email`` no longer intercept the call made by | ||
| ``send_email_smtp``. Patch ``airflow.providers.smtp.utils.emailer.send_mime_email`` instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.