Has anyone managed to get Django to send emails when hosted on Dreamhost?

Hi,

Does anyone know what are the required fields to send Django messages when an "500 internal server error" occurs? I accept my project on Dreamhost, and for life I can not get Django to send emails. What are the required fields when hosting on Dreamhost?

+7
python django dreamhost
source share
5 answers

As suggested by S.Mark, you can use gmail. Here is what you need in settings.py

ADMINS = ( ('Your Name', 'your_name@email.com'), ) EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_HOST_PASSWORD = 'password' EMAIL_HOST_USER = 'gmail_account' EMAIL_SUBJECT_PREFIX = 'something' EMAIL_USE_TLS = True 
+17
source share

Yes, I am the same on dreamhost, but I use gmail to send email, as the following code example

 import smtplib m = smtplib.SMTP("smtp.gmail.com", 587) m.ehlo() m.starttls() m.ehlo() m.login(USERNAME, PASSWD) m.sendmail(user, to, "From: %s\nTo: %s\n\nHello World!"%(USERNAME,TOADDR)) m.close() 
+1
source share

Do you have an SMTP server configured anywhere? As the people here suggest, you can easily use gmail, but you are in no way limited to using only the Gmails SMTP server. You can create your own on your equipment if you want, or you can use several free SMTP servers. I would say that the most interesting thing is to configure your own mailbox and create your own SMTP server;)

0
source share

One of the problems that we encountered in this gmail operation is that if you try to test by sending it from your gmail account to dreamhost email, which is sent back to the same gmail, the message will be deleted. It might be some kind of weird security feature that dreamhost happens to.

0
source share

Try using:

 EMAIL_HOST = "localhost" 

instead of resolving DNS ...

0
source share

All Articles