Quellcode durchsuchen

Doc'd send_email() behavior when from_email is None.

Adrian D'Alessandro vor 4 Jahren
Ursprung
Commit
235b681351
2 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  1. 1 0
      django/core/mail/__init__.py
  2. 2 1
      docs/topics/email.txt

+ 1 - 0
django/core/mail/__init__.py

@@ -42,6 +42,7 @@ def send_mail(subject, message, from_email, recipient_list,
     Easy wrapper for sending a single message to a recipient list. All members
     of the recipient list will see the other recipients in the 'To' field.
 
+    If from_email is None, use the DEFAULT_FROM_EMAIL setting.
     If auth_user is None, use the EMAIL_HOST_USER setting.
     If auth_password is None, use the EMAIL_HOST_PASSWORD setting.
 

+ 2 - 1
docs/topics/email.txt

@@ -51,7 +51,8 @@ are required.
 
 * ``subject``: A string.
 * ``message``: A string.
-* ``from_email``: A string.
+* ``from_email``: A string. If ``None``, Django will use the value of the
+  :setting:`DEFAULT_FROM_EMAIL` setting.
 * ``recipient_list``: A list of strings, each an email address. Each
   member of ``recipient_list`` will see the other recipients in the "To:"
   field of the email message.