[Django]-Python Django Gmail SMTP setup

26👍

Your gmail.smtp setup is correct. It looks like you are not calling the send_email function correctly, and that’s why it’s not sending. In the python shell, try the following:

import django
from django.conf import settings
from django.core.mail import send_mail

send_mail('Subject here', 'Here is the message.', settings.EMAIL_HOST_USER,
    ['to@example.com'], fail_silently=False)

2👍

Try to change EMAIL_USE_TLS=True to EMAIL_USE_SSL=True and EMAIL_PORT=465

https://docs.djangoproject.com/en/1.10/topics/email/

Leave a comment