Question: I'm building a website using Underscore + Backbone.
Basically I want to know if it's possible to send an email from a contact form.

This is my Backbone Model :

```
class ContactModel extends Backbone.Model

    defaults :
        message : 'Default message'

    validate : ( attrs_ ) ->

        # Validation Logique

    sync : (method, model) ->

        xhr = $.ajax
                dataType: "json"
                type: "POST"
                url: # HERE I WANT TO SEND DATA TO GOOGLE APPENGINE
                data: model.toJSON() 

                success : ( jqXHR, textStatus ) =>

                    console.log 'Success', 'jqXHR_ :', jqXHR, 'textStatus_ :', textStatus

                error : ( jqXHR_, textStatus_, errorThrown_ ) ->

                    console.log 'Success', 'jqXHR_ :', jqXHR_, 'textStatus_ :', textStatus_, 'errorThrown_ :', errorThrown_

```

My Question is : Is it possible to retrieve the JSON sent from my model in my app engine in order to send the Model's message attribut to my email address using python

Answer: 
Yes. Just create a POST hander, get the request.body and use json to turn it into something you can use in python, then send the email.

[Getting Started With Forms](https://developers.google.com/appengine/docs/python/gettingstarted/handlingforms)

```
class Guestbook(webapp.RequestHandler):
def post(self):
    data = self.response.body
    jdata = json.loads(data)
    #send email with data in jdata

```
Finally I sort out this situation with the following code :

```
import os
import webapp2
import logging
import json
from google.appengine.api import mail

class MainPage(webapp2.RequestHandler):

    def get(self):

        #If request comes from the App

        if self.request.referer == 'Your request.referer' :

            message = self.request.get('message')

            #If there is no message or message is empty

            if not message and len(message) == 0:

                self.response.headers.add_header('content-type', 'text/plain', charset='utf-8')

                self.response.out.write('An empty message cannot be submitted')

                return

            #Print message

            logging.info('Message : ' + message)

            #Set email properties

            user_address = 'user_address'
            sender_address = 'sender_address'
            subject = 'Subject'
            body = message

            #Send Email

            mail.send_mail(sender_address, user_address, subject, body)

        #If request comes from unknow sources

        else :

            self.response.headers.add_header('content-type', 'text/plain', charset='utf-8')

            self.response.out.write('This operation is not allowed')

            return

app = webapp2.WSGIApplication([('/', MainPage)])

```