App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
google.appengine.api.mail.InboundEmailMessage Class Reference
Inheritance diagram for google.appengine.api.mail.InboundEmailMessage:
google.appengine.api.mail.EmailMessage google.appengine.api.mail._EmailMessageBase

Public Member Functions

def update_from_mime_message
 
def bodies
 
def to_mime_message
 
- Public Member Functions inherited from google.appengine.api.mail.EmailMessage
def check_initialized
 
def CheckInitialized
 
def ToProto
 
def __setattr__
 
def update_from_mime_message
 

Public Attributes

 alternate_bodies
 
- Public Attributes inherited from google.appengine.api.mail.EmailMessage
 to
 
 cc
 
 bcc
 

Static Public Attributes

tuple PROPERTIES
 
 ALLOW_BLANK_EMAIL = True
 
- Static Public Attributes inherited from google.appengine.api.mail.EmailMessage
tuple PROPERTIES = set(_EmailMessageBase.PROPERTIES | set(('headers',)))
 

Detailed Description

Parsed email object as recevied from external source.

Has a date field and can store any number of additional bodies.  These
additional attributes make the email more flexible as required for
incoming mail, where the developer has less control over the content.

Example Usage:

  # Read mail message from CGI input.
  message = InboundEmailMessage(sys.stdin.read())
  logging.info('Received email message from %s at %s',
               message.sender,
               message.date)
  enriched_body = list(message.bodies('text/enriched'))[0]
  ... Do something with body ...

Member Function Documentation

def google.appengine.api.mail.InboundEmailMessage.bodies (   self,
  content_type = None 
)
Iterate over all bodies.

Args:
  content_type: Content type to filter on.  Allows selection of only
specific types of content.  Can be just the base type of the content
type.  For example:
  content_type = 'text/html'  # Matches only HTML content.
  content_type = 'text'       # Matches text of any kind.

Yields:
  Tuple (content_type, payload) for all bodies of message, including body,
  html and all alternate_bodies in that order.
def google.appengine.api.mail.InboundEmailMessage.to_mime_message (   self)
Convert to MIME message.

Adds additional headers from inbound email.

Returns:
  MIME message instance of payload.
def google.appengine.api.mail.InboundEmailMessage.update_from_mime_message (   self,
  mime_message 
)
Update values from MIME message.

Copies over date values.

Args:
  mime_message: email.Message instance to copy information from.

Member Data Documentation

tuple google.appengine.api.mail.InboundEmailMessage.PROPERTIES
static
Initial value:
1 = frozenset(_EmailMessageBase.PROPERTIES |
2  set(('alternate_bodies',)) |
3  set(__HEADER_PROPERTIES.iterkeys()))

The documentation for this class was generated from the following file: