6๐
โ
You need to add SMTP server settings to your settings.py
file. Example:
EMAIL_HOST = 'smtp.example.com'
EMAIL_PORT = 25
EMAIL_HOST_USER = 'mailer@example.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_USE_TLS = True
From Django documentation:
Mail is sent using the SMTP host and port specified in the EMAIL_HOST and EMAIL_PORT settings. The EMAIL_HOST_USER and EMAIL_HOST_PASSWORD settings, if set, are used to authenticate to the SMTP server, and the EMAIL_USE_TLS setting controls whether a secure connection is used.
๐คKonrad Haลas
3๐
set allow lesssecureapps ON for your gmail account which you have used as EMAIL_HOST
from here
https://myaccount.google.com/lesssecureapps
along with this settings in settings.py
EMAIL_HOST = 'smtp.example.com'
EMAIL_PORT = 25
EMAIL_HOST_USER = 'mailer@example.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_USE_TLS = True
- [Django]-How to access extra data sent with POST request in Django Rest Framework serializer
- [Django]-Django: How do you access a model's instance from inside a manager?
- [Django]-Django unable to render logout template
- [Django]-Django get current view in template
Source:stackexchange.com