diff options
| author | Mike Edmunds <medmunds@gmail.com> | 2026-04-07 13:27:52 -0700 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2026-04-16 15:39:03 -0300 |
| commit | 5a79a092af43ad59220e2237cd5f90f6d628deab (patch) | |
| tree | 5666e80dfe567065a43d7654cfa7051c81865913 | |
| parent | 4593ae93ae39d0c33ef9edc667fe3425fcf61b28 (diff) | |
Refs #35514 -- Moved get_connection() after backends in email docs.
Moved "Obtaining an instance of an email backend" after documentation
for individual backends (matching similar approach in Tasks docs).
| -rw-r--r-- | docs/topics/email.txt | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/docs/topics/email.txt b/docs/topics/email.txt index 09d4b68b1a..36f7b71e97 100644 --- a/docs/topics/email.txt +++ b/docs/topics/email.txt @@ -688,34 +688,11 @@ It can also be used as a context manager, which will automatically call connection=connection, ).send() -Obtaining an instance of an email backend ------------------------------------------ - -The :func:`get_connection` function in ``django.core.mail`` returns an -instance of the email backend that you can use. - -.. function:: get_connection(backend=None, *, fail_silently=False, **kwargs) - -By default, a call to ``get_connection()`` will return an instance of the -email backend specified in :setting:`EMAIL_BACKEND`. If you specify the -``backend`` argument, an instance of that backend will be instantiated. - -The keyword-only ``fail_silently`` argument controls how the backend should -handle errors. If ``fail_silently`` is True, exceptions during the email -sending process will be silently ignored. - -All other keyword arguments are passed directly to the constructor of the -email backend. - Django ships with several email sending backends. With the exception of the SMTP backend (which is the default), these backends are only useful during testing and development. If you have special email sending requirements, you can :ref:`write your own email backend <topic-custom-email-backend>`. -.. deprecated:: 6.0 - - Passing ``fail_silently`` as positional argument is deprecated. - .. _topic-email-smtp-backend: SMTP backend @@ -844,6 +821,29 @@ delivered messages. If your backend has any concept of a persistent session or connection, you should also implement the ``open()`` and ``close()`` methods. Refer to ``smtp.EmailBackend`` for a reference implementation. +Obtaining an instance of an email backend +----------------------------------------- + +The :func:`get_connection` function in ``django.core.mail`` returns an +instance of the email backend that you can use. + +.. function:: get_connection(backend=None, *, fail_silently=False, **kwargs) + +By default, a call to ``get_connection()`` will return an instance of the +email backend specified in :setting:`EMAIL_BACKEND`. If you specify the +``backend`` argument, an instance of that backend will be instantiated. + +The keyword-only ``fail_silently`` argument controls how the backend should +handle errors. If ``fail_silently`` is True, exceptions during the email +sending process will be silently ignored. + +All other keyword arguments are passed directly to the constructor of the +email backend. + +.. deprecated:: 6.0 + + Passing ``fail_silently`` as positional argument is deprecated. + .. _topics-sending-multiple-emails: Sending multiple emails |
