straight55b / app-engine-patch

Automatically exported from code.google.com/p/app-engine-patch
0 stars 0 forks source link

mail service #247

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.incoming email 
2.
3.

What is the expected output? What do you see instead?
I'd like to see the email.

What version of the product are you using? On what operating system?
1.1 RC

Please provide any additional information below.
Does anyone have an example of handling/processing incoming email. I've 
configured my app to receive email, but I'm confused regarding how to get 
it and its contents. I'm following the docs at 
http://code.google.com/appengine/docs/python/mail/receivingmail.html
but I'm not sure how to adapt the example in my django code. So far I've 
got:
url.py
(r'^_ah/mail/.+$','myapp.views.inbound_mail'),
views.py
class LogSenderHandler(InboundMailHandler):
    def receive(self, mail_message):
        return logging.info("Received a message from: " + 
mail_message.sender)

def inbound_mail(request):

    return HttpResponse(request.POST)

Any thoughts or help are appreciated. Thanks!

Original issue reported on code.google.com by MMacK3...@gmail.com on 10 Dec 2009 at 11:31

GoogleCodeExporter commented 9 years ago
I'm no super Django expert, but given the framework I wouldn't be surprise if 
it 
cannot receive email that way, unless override some a the framework default 
handlers 
mechanics.

Why don't you define in your app.yaml a "basic" GAE handler to receive the 
email and 
than in it, do an URLfetch to your django handler, passing the email in the 
payload. 
That way you can use the sample "as is" and still get the stuff in your django 
app.

Make sure to propagate/translate the URLfetch errors back to your email server.

Cheers,
Sebastien

Original comment by sebastie...@gmail.com on 12 Dec 2009 at 11:31