/ Published in: Django
Expand |
Embed | Plain Text
In settings.py EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = 'youremail@gmail.com' EMAIL_HOST_PASSWORD = 'yourpassword' EMAIL_PORT = 587 You can use the shell to test it: >>> from django.core.mail import send_mail >>> send_mail('Test', 'This is a test', 'from@somewhere.com', ['youremail@somewhere.com'])
Comments
Subscribe to comments
You need to login to post a comment.

I setup django settings.py file for sending e-mails, as described in "Django send email through Gmail" example. But when I ran the django shell, the only way to send the email successfully was to add authuser and authpassword as parameters in send_mail call. It's no big deal for me to add them, but I was still mystified that I could not duplication your example.
I apologize for my Nov. 18th posting. Code in this snippet works just fine. My mistake.
Can this email handling be used in the website contact form ? Please assist regarding it. seo reseller packages