# Functions - Google App Engine - Google Code

English ▼
Skip to page content Skip to main navigation
e.g. "templates" or "datastore"

# Functions

The `google.appengine.api.mail` package provides the following functions:

check_email_valid(email_address, field)

  Checks that an email address is valid, and raises an InvalidEmailError exception if it is not. `field` is the name of the field containing the address, for use in the error message.

invalid_email_reason(email_address, field)

  Returns a string description of why a given email address is invalid, or `None` if the address is valid. `field` is the name of the field containing the address, for use in the error message.

invalid_headers_reason(headers)

  Returns a string description of why a given dictionary of headers is invalid, or `None` if the headers are valid.

is_email_valid(email_address)

  Returns `True` if email_address is a valid email address. This performs the same check as check_email_valid, but does not raise an exception.

send_mail(sender, to, subject, body, **kw)

  Creates and sends a single email message. sender, to, subject, and body are required fields of the message. Additional fields can be specified as keyword arguments. For the list of possible fields, Email Message Fields.

send_mail_to_admins(sender, subject, body, **kw)

  Creates and sends a single email message addressed to all administrators of the application. sender, subject, and body are required fields of the message. Additional fields can be specified as keyword arguments. For the list of possible fields, Email Message Fields.