5👍
The solution that worked for me is posted here.
I used Flask but the error was exactly the same. I made sure that my credentials were correct and the environment variables were not enclosed in quotes like Eddy Ogola suggested.
The short answer from this post is to click this link while logged into the google account associated with the gmail you’re sending from.
Google doesn’t trust most scripts to login to your account, so they put the onus on the owner of the gmail to give "less secure apps" permission to access your gmail.
4👍
I had the same issue. I solved it with resetting the os environment variables, the values shouldn’t be enclosed in quotes. For example, MAIL_USERNAME=blah@gmail.com. It should work.
1👍
I got the same error while working in Django
I resolved it by just setting the google account form Less secure app access (off) to (on)
so perform this option
Change your Google account settings to allow less secure apps to access your account. (It’s not recommended because it might make it easier for someone to break into your account). if you want to allow access anyway, follow these steps:
- Go to "Less Secure apps" section
- next to "access for less secure apps," select Turn on.
0👍
I had the same issue,
How I fixed it ?
Step 1: Check if the credentials is correct(email and password),
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com' // can also use yahoo
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST_USER = 'yourmail@gmail.com'
EMAIL_HOST_PASSWORD = 'yourpassword'
DEFAULT_FROM_EMAIL = '<anything you want>'
Step 2: Check if this is turned ON (if not turn it ON)
0👍
quick answer : go to lesssecureapps session of your google account
than select turn on
more detail :
if all your configurations are correct , this error might be because of django trying to login to your application and gmail does not recognize him
0👍
I managed to solve this problem by enabling the email I’m going to use for 2-factor verification, generating an app password.
- [Django]-UWSGI async functions don't know about Django's logging settings
- [Django]-Collectstatic command excluding nested directories and files
- [Django]-Detect the language & django locale-url
- [Django]-Installing a Module on Heroku
0👍
Firstly go to: https://myaccount.google.com/security and turn on 2-step verification, after you have turn on 2-step verification you can generate app password after you generate a password paste it in your setting at EMAIL_HOST_PASSWORD.
0👍
Less secure app access is no longer available.
so follow this steps:
- Go to your google account and Active you 2-steps verification
- Search app password
- Choose other and set a name
- Copy password and paste in EMAIL_HOST_PASSWORD in django setting