#29730 closed Cleanup/optimization (wontfix)
Clarify email docs about what "successfully delivered messages" means
Reported by: | ovalseven8 | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Today, I read through the "Sending email" documentation and it raised a few question to me. So I am asking if perhaps you could clarify it in the docs. In case someone can help, I can then create the pull request if you want to.
My raised questions:
- What does "successfully delivered messages" exactly mean?
-
In the docs you say the return value of
send_mail()
orsend_mass_mail()
is the number of "successfully delivered messages". But what does this mean exactly? Let's say a new user registers on my website and uses an actually not existing email address likegh37ddg3@457f3838f.com
. Willsend_mail()
then always return0
? Or what is when the SMTP connection is successful, and the email server will just try to deliver the message several times? Will it then return1
when the delivery to the SMTP server was successful or really only when the recipient's server got the mail? I hope you could clarify this. - Another question about fail_silently
-
Assuming
fail_silently=False
. Will thensend_mail()
only be able to return1
and raise an Exception or could it also be that it returns0
? - Question to send_mass_mail()
-
Assuming I want to send 600 emails. Now, in the middle of the process, send_mass_mail() fails and returns that
20
emails have been delivered. How do I know which emails have been sent and which are still to be sent? In casefail_silently=False
: Will the Exception also contain the number of "successfully delivered messages"?
Change History (2)
comment:1 by , 6 years ago
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
Version: | 2.1 → master |
comment:2 by , 6 years ago
Resolution: | needsinfo → wontfix |
---|---|
Summary: | Update docs for sending emails → Clarify email docs about what "successfully delivered messages" means |
A PR was provided, but I agree with the wontfix sentiment.
Note:
See TracTickets
for help on using tickets.
You'll want to look in https://github.com/django/django/tree/master/django/core/mail. Particularly in the SMTP backend.
More or less I think the quick answers to your questions are:
fail_silently=False
you'll either get a return fromsend_mail()
or an exception being raised. Not both.fail_silently
). If you need more complex behaviour you'll need your own backend.In principle clarifications to the docs are always welcome. If you want look at the code, check these answers, and to roll-up them up into a PR that would be great.
Pending that I'm going to mark this as
needsinfo
as I'm not sure exactly what you have in mind here.