views:

442

answers:

4

How can I fetch mails from gmail account in Google Apps Engine Django application?

A: 

Just use the Python's standard POP or IMAP client. Google does not provide a GMail API.

Triptych
You can't open sockets on App Engine.
Nick Johnson
Maybe he just did not know better. Sometimes I think the down votting is kind of cruel
Alfred
Haha it's fine. Thanks for standing up for me.
Triptych
No problem, because I understand when somebody is really posting dumb stuff about php instead of python or flaming that he gets down voted. But this..?
Alfred
@Alfred - it is a bad answer based on a reasonable misunderstanding. I think other people might try the approach I suggested, but it won't work for the reason Nick Johnson cited. In my opinion it should be downvoted once and left as a warning. I only have issue when innocently wrong answers are downvoted multiple times.
Triptych
A: 

You could cronjob rss feed to gmail messages?

gmail rss

python cron

Alfred
A: 

I would use libgmail -- seems to be the most popular pure-Python way to do it. However for app engine use I believe it would have to be ported to use urlfetch and I don't think anybody's done that yet (I'd happily receive news to the contrary!-).

Alex Martelli
+2  A: 

Configure your app to receive email, then, if it really has to be a gmail address, set up the gmail address to forward everything to your appspot address.

Nick Johnson