I found a lot of posts regarding send email with django, but I've a specific problem with gmail:
here are my settings:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = "smtp.gmail.com"
EMAIL_HOST_USER = "myemail@gmail.com"
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
EMAIL_HOST_PASSWORD = 'mypassword
EMAIL_PORT = 587
EMAIL_USE_TLS = True
and my view is:
from django.core.mail import EmailMessage, send_mail
if request.method == 'POST':
name = request.POST.get('name','')
email = request.POST.get('email','')
subject = request.POST.get('subject','')
text = request.POST.get('text','')
message = 'From: ' + email + '\n\n\n' + text
send_mail(subject, message, 'myemail@gmail.com', ['myemail@gmail.com'], fail_silently=False)
Can you please tell me why I get this error? I also checked for google settings like "access from less secure applications" and similar
thank you in advance!!!
edit
I've already allowed less secure apps and clicked on unlock captcha