Is there any way to send an email in a Django project without turning on the "allow less secure apps" feature? Is using OAuth2 a must or can I send it using Google's API?
So far, I just use:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = '587'
EMAIL_HOST_USER = 'myemailaddress'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_USE_TLS = True
EMAIL_USE_SSL = False
But this gives me an SMTPAuthenticationError, which only works when I turn on "allow less secure apps" in Google. Is there any way to circumvent this without using OAuth2 and allow multiple users to login to that account easily?
Using the
gmail app password
through you can send the email not provide the actual password and no one can login in your account. Without enable less secure apps setting here is give the link try and it's work let me know if it right google or gmail app password
after it change the actual password to your app password in
setting.py
file EMAIL_HOST_PASSWORD = 'your app password'
give by google
not change in other constant
if you do not use 2 step email verification you need to use third party service here i give the link you see sendgrid
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With