An instance of the EmailMessage class represents an email message, and includes a method to send the message using the App Engine Mail service.
EmailMessage is provided by the
An EmailMessage instance represents an email message to be sent using the App Engine Mail service. An email message has a set of fields, which can be initialized using the constructor, and adjusted using attributes of the instance.
For a list of the fields of an EmailMessage, see Email Message Fields.
When all of the appropriate fields are set, the send() method sends the email message using the current values of the fields. An EmailMessage instance can be reused to send multiple messages with similar field values.
- class EmailMessage(**kw)
An email message to be sent via the Mail API.
The fields of the message can be initialized using keyword arguments passed to the constructor. For a list of possible fields, see Email Message Fields.
Fields can also be set after construction using attributes of the instance, or by passing keyword arguments to the initialize() method.
An EmailMessage instance has the following methods:
Checks if the EmailMessage is properly initialized for sending. If the message is not properly initialized, the method raises an error that corresponds with the first problem it finds. Returns without raising an error if the message is ready to send.
- Sets fields of the email message using keyword arguments. For a list of possible fields, see Email Message Fields.
Trueif the EmailMessage is properly initialized for sending. This performs the same checks as check_initialized(), but does not raise an error.
- Sends the email message.