Python 2.7 has reached end of support
and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Python
2.7 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you
migrate to the latest supported version of Python.
Stay organized with collections
Save and categorize content based on your preferences.
google.appengine.api.mail_errors module
Summary
Exceptions raised by the Mail API.
Contents
- exception google.appengine.api.mail_errors.Errorsource
-
Bases: exceptions.Exception
Base Mail error type.
- exception google.appengine.api.mail_errors.MissingBodyErrorsource
-
Bases: google.appengine.api.mail_errors.Error
A body was not specified in the message.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["\u003cp\u003eThis module, \u003ccode\u003egoogle.appengine.api.mail_errors\u003c/code\u003e, defines the exceptions that can be raised by the Mail API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eError\u003c/code\u003e exception serves as the base class for all mail-related errors within this API.\u003c/p\u003e\n"],["\u003cp\u003eSeveral specific exception types exist for handling issues like invalid emails, attachments, or headers, such as \u003ccode\u003eInvalidEmailError\u003c/code\u003e, \u003ccode\u003eInvalidAttachmentTypeError\u003c/code\u003e, and \u003ccode\u003eInvalidHeaderNameError\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eErrors related to message content, like missing elements, are represented by exceptions like \u003ccode\u003eMissingBodyError\u003c/code\u003e, \u003ccode\u003eMissingRecipientsError\u003c/code\u003e, \u003ccode\u003eMissingSenderError\u003c/code\u003e, and \u003ccode\u003eMissingSubjectError\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEncoding related issues are covered by \u003ccode\u003ePayloadEncodingError\u003c/code\u003e and its subclasses, including \u003ccode\u003eUnknownCharsetError\u003c/code\u003e and \u003ccode\u003eUnknownEncodingError\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# google.appengine.api.mail_errors module\n=======================================\n\nSummary\n-------\n\nExceptions raised by the Mail API.\n\nContents\n--------\n\n*exception* google.appengine.api.mail_errors.BadRequestError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#BadRequestError)\n\n: Bases: [google.appengine.api.mail_errors.Error](#google.appengine.api.mail_errors.Error)\n\nThe email is not valid. \n\n*exception* google.appengine.api.mail_errors.Error[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#Error)\n\n: Bases: exceptions.Exception\n\nBase Mail error type. \n\n*exception* google.appengine.api.mail_errors.InvalidAttachmentTypeError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#InvalidAttachmentTypeError)\n\n: Bases: [google.appengine.api.mail_errors.Error](#google.appengine.api.mail_errors.Error)\n\nThe file type of the attachment is invalid. \n\n*exception* google.appengine.api.mail_errors.InvalidEmailError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#InvalidEmailError)\n\n: Bases: [google.appengine.api.mail_errors.Error](#google.appengine.api.mail_errors.Error)\n\nThe specified email is invalid. \n\n*exception* google.appengine.api.mail_errors.InvalidHeaderNameError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#InvalidHeaderNameError)\n\n: Bases: [google.appengine.api.mail_errors.Error](#google.appengine.api.mail_errors.Error)\n\nThe header name is invalid. \n\n*exception* google.appengine.api.mail_errors.InvalidSenderError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#InvalidSenderError)\n\n: Bases: [google.appengine.api.mail_errors.Error](#google.appengine.api.mail_errors.Error)\n\nThe sender is not permitted to send mail for this application. \n\n*exception* google.appengine.api.mail_errors.MissingBodyError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#MissingBodyError)\n\n: Bases: [google.appengine.api.mail_errors.Error](#google.appengine.api.mail_errors.Error)\n\nA body was not specified in the message. \n\n*exception* google.appengine.api.mail_errors.MissingRecipientsError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#MissingRecipientsError)\n\n: Bases: [google.appengine.api.mail_errors.Error](#google.appengine.api.mail_errors.Error)\n\nA recipient was not specified in the message. \n\n*exception* google.appengine.api.mail_errors.MissingSenderError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#MissingSenderError)\n\n: Bases: [google.appengine.api.mail_errors.Error](#google.appengine.api.mail_errors.Error)\n\nA sender was not specified in the message. \n\n*exception* google.appengine.api.mail_errors.MissingSubjectError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#MissingSubjectError)\n\n: Bases: [google.appengine.api.mail_errors.Error](#google.appengine.api.mail_errors.Error)\n\nThe subject was not specified in the message. \n\n*exception* google.appengine.api.mail_errors.PayloadEncodingError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#PayloadEncodingError)\n\n: Bases: [google.appengine.api.mail_errors.Error](#google.appengine.api.mail_errors.Error)\n\nThe payload encoding is unknown. \n\n*exception* google.appengine.api.mail_errors.UnknownCharsetError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#UnknownCharsetError)\n\n: Bases: [google.appengine.api.mail_errors.PayloadEncodingError](#google.appengine.api.mail_errors.PayloadEncodingError)\n\nThe character set is unknown. \n\n*exception* google.appengine.api.mail_errors.UnknownEncodingError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/mail_errors#UnknownEncodingError)\n\n: Bases: [google.appengine.api.mail_errors.PayloadEncodingError](#google.appengine.api.mail_errors.PayloadEncodingError)\n\n The encoding is unknown."]]