all. Have a troubles with email sending in django. Have next in my settings.py
EMAIL_USE_TLS = True
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_HOST_USER = '[email protected]'
Try to call function send_mail from django.core.mail:
send_mail('Subject here', 'Here is the message.', settings.EMAIL_HOST_USER,
['[email protected]', ], fail_silently=False)
Have next output:
Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Subject here From: [email protected] To: [email protected] Date: Mon, 23 Sep 2019 09:57:10 -0000 Message-ID: <20190923095710.1383.3314> Here is the message.
But I have not any messages in my mail client. Have checked Spam folder too - it's empty.
Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Subject here From: [email protected] To: [email protected] Date: Mon, 23 Sep 2019 09:57:10 -0000 Message-ID: <20190923095710.1383.3314> Here is the message.EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'. make sure that there is no line of code like thisEMAIL_BACKENDnot be overridden. Make sure that it always has this valueEMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'