# Exceptions - Google App Engine - Google Code

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

# Exceptions

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

exception Error()

  This is the base class for all exceptions in this package.

exception BadRequestError()

  The Mail service rejected the EmailMessage as invalid, and no other error applies.

exception InvalidSenderError()

  The EmailMessage has a `sender` that is not valid for this application. The sender 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.

exception InvalidEmailError()

  An email address is not valid. Only valid email addresses are allowed for email address fields, such as `sender` or `to`.

exception InvalidAttachmentTypeError()

  The EmailMessage has at least one attachment with a filename extension that is not allowed. See the Mail Service overview for a list of allowed filename extensions.

exception InvalidHeaderNameError()

  The EmailMessage has at least one header that is not allowed. See the Mail Service Overview for a list of allowed headers.

exception MissingRecipientsError()

  The EmailMessage does not have recipients set in any of these fields: `to`, `cc`, `bcc`. At least one recipient must be set to send the message.

exception MissingSenderError()

  The EmailMessage is missing a value for the `sender` field. The `sender` must be set to send the message.

exception MissingSubjectError()

  The EmailMessage is missing a value for the `subject` field. The `subject` must be set to send the message.

exception MissingBodyError()

  The EmailMessage is missing a value for the `body` field. The `body` must be set to send the message.