send_mail
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.
def send_mail(
subject: string,
message: string,
from_email: string,
recipient_list: list,
fail_silently: boolean = False,
auth_user: string = None,
auth_password: string = None,
connection: EmailBackend = None,
html_message: string = None,
using: string = None
) - > int
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.
Parameters
| Name | Type | Description |
|---|---|---|
| subject | string | The subject line of the email. |
| message | string | The plain-text body of the email. |
| from_email | string | The sender's email address; if None, the DEFAULT_FROM_EMAIL setting is used. |
| recipient_list | list | A list of strings, each an email address of a recipient. |
| fail_silently | boolean = False | Whether to suppress exceptions raised during the sending process. |
| auth_user | string = None | The username to use for authenticating with the SMTP server. |
| auth_password | string = None | The password to use for authenticating with the SMTP server. |
| connection | EmailBackend = None | An optional email backend instance to use for sending the mail. |
| html_message | string = None | An optional HTML version of the message body to be sent as a multipart/alternative. |
| using | string = None | The name of the email backend alias to use for sending the message. |
Returns
| Type | Description |
|---|---|
int | The number of successfully delivered messages (typically 1 if successful). |