Chapter 11. Sending and Receiving Mail and Instant Messages

App Engine apps can communicate with the outside world in three ways. The first method we covered in Chapter 10: an app can receive and respond to HTTP requests, and an app can initiate HTTP requests and get responses with the URL Fetch service.

The second method of networked communication available to apps is email. An app can send email messages by calling the Mail service with message data and a list of recipients. An app can also receive email messages at any of several addresses monitored by App Engine.

The third method is instant messages, specifically the XMPP protocol. An app can participate in a chat dialog with a user of any XMPP-compatible chat service, including Google Talk and any Jabber server. An app can also use XMPP to communicate with custom clients via such services. App Engine does not act as an XMPP service itself; instead, it connects to Google Talk’s infrastructure to participate as a chat user.

An app might send email to notify users of system events or the actions of other users (such as to send social networking invitations), confirm user actions (such as to confirm an order), follow up on long-term user actions (such as to send a shipping notice for an order), or send system notifications to administrators. The app can send email on behalf of itself, the app’s administrators, or the currently signed-in user (during the request handler that’s sending the email).

An app can receive email sent to specific ...

Get Programming Google App Engine now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.