Sending emails with Django its quite easy, you just need to edit your project settings.py and add:
#SMTP Server configuration
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'your_email@gmail.com'
EMAIL_HOST_PASSWORD = 'your_password'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
then save it and open a python terminal by running:
>>> from django.core.mail import send_mail
>>>send_mail('Django mail', 'This e-mail was sent with Django' ,
'your_account@gmail.com', ['your_account@gmail.com'], fail_silently =False)
after if you get back "1" everything went ok.
You May need to enable access for less secured apps at https://www.google.com/settings/security/lesssecureapps.
#SMTP Server configuration
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'your_email@gmail.com'
EMAIL_HOST_PASSWORD = 'your_password'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
then save it and open a python terminal by running:
>>> from django.core.mail import send_mail
>>>send_mail('Django mail', 'This e-mail was sent with Django' ,
'your_account@gmail.com', ['your_account@gmail.com'], fail_silently =False)
after if you get back "1" everything went ok.
You May need to enable access for less secured apps at https://www.google.com/settings/security/lesssecureapps.