waigani
waigani

Reputation: 3580

GAE get info (headers) on an inbound email

I'm using python 2.7 on GAE. When a user makes a request via a browser, I can get 'meta details' such as IP, browser type, request time and the user object, if they are logged in.

I have set up GAE to receive emails. What equivalent kind of 'meta details' can I retrieve from an inbound email and how do I get that information?

Upvotes: 1

Views: 118

Answers (1)

Maria Zverina
Maria Zverina

Reputation: 11163

The InboundEmailMessage class has the most frequently used fields ready for direct access. These are:

  • subject
  • sender
  • to
  • cc
  • date
  • attachments
  • original

It also include original field that exposes the full meessage as a Python email.message.Message - this allows you access to all the email headers and potentially lots more.

Upvotes: 3

Related Questions