An email message has several fields of information. Fields can be set as keyword arguments to the EmailMessage constructor, as keyword arguments to the initialize() method, or as attributes of an EmailMessage instance. You can create and send a single email message by calling the send_mail() function with the fields as keyword arguments.
An email address can be just the email address (
[email protected]
) or a formatted name and email address, such as:
Albert Johnson <[email protected]>
You can provide any formatted name with the sender address or a recipient address, as long as the address meets the requirements. (See
RFC 822
for a complete specification for the format of an address and
email.utils
for information on address parsing.)
The following are the possible fields of an email message:
-
sender
-
The email address of the sender, the
From
address. The sender address must be one of the following types: