Opened 7 years ago
Last modified 6 years ago
#29430 closed Cleanup/optimization
django.core.mail.send_mail()'s fail_silently kwarg is documented incorrectly — at Initial Version
Reported by: | ティン・ルーフ | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 2.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
From https://docs.djangoproject.com/en/2.0/topics/email/#send-mail: “If it’s False, send_mail will raise an smtplib.SMTPException.”
This is often untrue, and certainly misleading. Certainly, if it's False, send_mail is capable of raising SMTPException, but it's not guaranteed.
I was going to open a pull request and change it to “If it's True, send_mail can raise smtplib.SMTPException”, but I'm not confident that other exceptions cannot be raised, or that send_mail will never raise SMTPException if fail_silently is True.