Google Code offered in: 中文 - English - Português - Pусский - Español - 日本語
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.
A recipient email address can be just the email address (Albert.Johnson@example.com
) or a formatted name and email address, such as: Albert Johnson <Albert.Johnson@example.com>
The sender address must be the email address only.
The following are the possible fields of an email message:
sender
From
address. This must be the email address of a registered administrator for the application, or the address of the current signed-in user. Administrators can be added to an application using the Administration Console. The current user's email address can be determined with the Users API.to
To:
line in the message header.cc
Cc:
line in the message header.bcc
reply_to
sender
address, the Reply-To:
field.subject
Subject:
line.body
html
attachments
The file attachments for the message, as a list of two-value tuples, one tuple for each attachment. Each tuple contains a filename as the first element, and the file contents as the second element.
An attachment file must be one of the allowed file types, and the filename must end with an extension that corresponds with the type. For a list of allowed types and filename extensions, see Allowed Attachment Types.