Greetings,
Does anyone know what are the required fields to have Django send emails when a "500 Internal Server Error" happend? I am hosting my project on Dreamhost and for the life of me I can't get Django to send emails. What are the required fields when hosting on Dreamhost?
Django ships with several email sending backends. With the exception of the SMTP backend (which is the default), these backends are only useful during testing and development. If you have special email sending requirements, you can write your own email backend.
With Django Admin Go to Django Admin, then to 'Mailboxes' page, check all the mailboxes you need to receive emails from. At the top of the list with mailboxes, choose the action selector 'Get new mail' and click 'Go'.
As proposed by S.Mark, you can use gmail. Here is what you need in your settings.py
ADMINS = (
('Your Name', '[email protected]'),
)
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
Yes, I am, same on dreamhost, but I am using gmail to send email like following sample code
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()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With