10
I have recently set this up and had a slightly different settings.py config.
Move:
EMAIL_USE_TLS = True
to the top above EMAIL_HOST
Add:
DEFAULT_FROM_EMAIL = 'user@gmail.com'
SERVER_EMAIL = 'user@gmail.com'
17
Change your settings like this :
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'user'
EMAIL_HOST_PASSWORD = 'your-password'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
Then try:
python manage.py shell
>>> from django.core.mail import EmailMessage
>>> email = EmailMessage('Mail Test', 'This is a test', to=['somemail@something.com'])
>>> email.send()
This should return with the status 1, which means it worked.
- [Django]-How to format time in django-rest-framework's serializer?
- [Django]-How to assign items inside a Model object with Django?
- [Django]-FileUploadParser doesn't get the file name
7
I had the same problem, and I searched for half a day to find a solution. Most of the proposed solutions are talking about where you should initialize EMAIL_USE_TLS in relation to the other settings. I don’t think this is a solution for the problem.
I found the solution at:
https://support.google.com/accounts/answer/185833?hl=en
and finally
https://security.google.com/settings/security/apppasswords
If you are testing your project on a local machine, you should go to the latter link, and enable “Access for less secure apps”.
- [Django]-Get list item dynamically in django templates
- [Django]-What does 'many = True' do in Django Rest FrameWork?
- [Django]-How do you detect a new instance of the model in Django's model.save()
0
EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend'
EMAIL_HOST='smtp.gmail.com'
EMAIL_PORT=465
EMAIL_HOST_USER = 'youruser'
EMAIL_HOST_PASSWORD = '*********'
DEFAULT_EMAIL_FROM = 'youremail@gmail.com'
works fine
- [Django]-Filtering dropdown values in django admin
- [Django]-Django 1.7 – App 'your_app_name' does not have migrations
- [Django]-POST jQuery array to Django
0
you have to go to this link
https://www.google.com/settings/u/2/security/lesssecureapps?pageId=none
and turn on the access for less secure apps
this option allows django to access your email and send email via it .
- [Django]-Django :How to integrate Django Rest framework in an existing application?
- [Django]-Django apps aren't loaded yet when using asgi
- [Django]-Django-taggit – how do I display the tags related to each record