How to send emails from django app to Google App Engine

I created one Django app, also hosted it in google engine. I can send emails from the django app, but after placing it in the app, I cannot. I am really stuck with this issue, so please tell me if there is any solution for using django email functionality in google app.

I tried appengine_django but it doesn't work.

Django version 1.3.1

python version 2.6.5

+3


source to share


4 answers


By default, Django comes with an email backend that uses sendmail to send email. Sendmail is not available on App Engine.

If you are using Django unreal it comes with an email backend that uses the GAE email service. https://github.com/django-nonrel/djangoappengine , take a look in mail.py



As far as I know, it has only been tested to work with the entire Django-nonrel framework. If you use it without the rest of the Django-relaunch, hacking is required.

+3


source


Google only allows email to be sent from a domain name that they control in the google engine. So, you either have to send it from the test domain they provided you, the gmail account, or you need to use your nameservers for your domain name.



+2


source


The problem has been resolved.

Just follow the link. http://andialbrecht.de/blog/2009/11/04/pluggable-app-engine-e-mail-backends-for-django.html

I think this is the easiest way to use Django email functionality in Google App Engine.

+2


source


Yes appengine_django doesn't work. you need to use djangoappengine.mail.EmailBackend so your settings.py should have:

EMAIL_BACKEND = 'djangoappengine.mail.EmailBackend'

      

Then you can use django's own send_mail function to send emails. I've tested it to work myself.

+2


source







All Articles