# Headers - Google App Engine - Google Code

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

# Headers

An email message can include headers. The `headers` field of an email message accepts a dictionary describing the headers. Each key:value pair of the dictionary corresponds to a header, where the key is the header name, and the value is the value of the header, as a string.

    from google.appengine.api import mail

    mail.send_mail(sender="support@example.com",
                   to="Albert Johnson <Albert.Johnson@example.com>",
                   subject="An example email",
                   body="""
    The email references a given email thread id.

    The example.com Team
    """,
                   headers={"References": email_thread_id})

Only certain header names are allowed. For more information, see Sending Mail with Headers.