diff options
| author | Praful Gulani <prafulgulani555@gmail.com> | 2026-02-12 20:03:25 +0530 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-03-16 12:51:58 -0400 |
| commit | 2333d56696141303000986a16553205ece993c67 (patch) | |
| tree | 16ec0e70baa0beee82dab88bddf264eaac8ce91e /docs | |
| parent | 455e787b9cc8bd3342f86ddcf8ef4103fd811bb5 (diff) | |
Fixed #36894 -- Added TypeError for conflicting arguments in mail APIs.
A TypeError is now raised if fail_silently=True, auth_user, or auth_password
are provided along a connection.
Updated AdminEmailHandler in django.utils.log to remove redundant
fail_silently=True.
Thanks Mike Edmunds for the report and Jacob Tyler Walls for the review.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/6.1.txt | 4 | ||||
| -rw-r--r-- | docs/topics/email.txt | 28 |
2 files changed, 32 insertions, 0 deletions
diff --git a/docs/releases/6.1.txt b/docs/releases/6.1.txt index 67891c5bf7..6b18331a1b 100644 --- a/docs/releases/6.1.txt +++ b/docs/releases/6.1.txt @@ -457,6 +457,10 @@ short-term maintenance releases. Django 6.1 supports MariaDB 10.11 and higher. Miscellaneous ------------- +* Providing ``fail_silently=True``, ``auth_user``, or ``auth_password`` to mail + sending functions (such as :func:`~django.core.mail.send_mail`) while also + providing a ``connection`` now raises a ``TypeError``. + * :class:`~django.contrib.contenttypes.fields.GenericForeignKey` now uses a separate descriptor class: the private ``GenericForeignKeyDescriptor``. diff --git a/docs/topics/email.txt b/docs/topics/email.txt index 6a32a0728e..c10aac2f80 100644 --- a/docs/topics/email.txt +++ b/docs/topics/email.txt @@ -120,6 +120,12 @@ can be ``0`` or ``1`` since it can only send one message). Passing ``fail_silently`` and later parameters as positional arguments is deprecated. +.. versionchanged:: 6.1 + + Older versions ignored ``fail_silently=True``, ``auth_user``, + and ``auth_password`` when a ``connection`` was also provided. + This now raises a ``TypeError``. + ``send_mass_mail()`` ==================== @@ -164,6 +170,13 @@ The return value will be the number of successfully delivered messages. Passing ``fail_silently`` and later parameters as positional arguments is deprecated. + +.. versionchanged:: 6.1 + + Older versions ignored ``fail_silently=True``, ``auth_user``, + and ``auth_password`` when a ``connection`` was also provided. + This now raises a ``TypeError``. + ``send_mass_mail()`` vs. ``send_mail()`` ---------------------------------------- @@ -198,6 +211,11 @@ If ``html_message`` is provided, the resulting email will be a Passing ``fail_silently`` and later parameters as positional arguments is deprecated. +.. versionchanged:: 6.1 + + Older versions ignored ``fail_silently=True`` when a ``connection`` + was also provided. This now raises a ``TypeError``. + ``mail_managers()`` =================== @@ -212,6 +230,11 @@ setting. Passing ``fail_silently`` and later parameters as positional arguments is deprecated. +.. versionchanged:: 6.1 + + Older versions ignored ``fail_silently=True`` when a ``connection`` + was also provided. This now raises a ``TypeError``. + Examples ======== @@ -403,6 +426,11 @@ email backend API :ref:`provides an alternative an exception. It will return ``1`` if the message was sent successfully, otherwise ``0``. + .. versionchanged:: 6.1 + + Older versions ignored ``fail_silently=True`` when a ``connection`` + was also provided. This now raises a ``TypeError``. + .. method:: message(policy=email.policy.default) Constructs and returns a Python :class:`email.message.EmailMessage` |
