Django email setup on Hostgator

On Hostgator it is possible to run Django applications with FastCgi, but it has only sendmail as email back-end which is not included in Django.

Hopefully there is a snipets to resolve this limitation. You just needed to change the path of the sendmail file and it was ready to run. The location of sendmail is "/usr/sbin/sendmail" on our Hostgator server.

And the email backend should be configured in your settings.py by adding the following line:

EMAIL_BACKEND = 'sendmail.EmailBackend'

4 comments:

geist3 said...

Cheers this helped me, staff were no use :)

Miguel Briceño said...

Hi, I have problems with sending email from django on hostgator, I read your post but I do not understand I have to do with the snippet, I put it in my project? or just change the variable EMAIL_BACKEND

Tibor Tóth said...

Hi Miguel,

1. Include the snippet in your project and change line 43 in it. Change the simple "sendmail" to the full path version.
ps = Popen(["/usr/sbin/sendmail"] ...

2. Chnage the EMAIL_BACKEND variable in your settings.

Regards,
Tibor

Miguel Briceño said...

thanks for your quick response, it solves the problem, just change the path I needed to say, I did not know where to place it.