i am trying to send contact form using email and am having this error
gaierror at /
[Errno 11001] getaddrinfo failed
if request.method == 'POST':
name = request.POST.get('name'),
email = request.POST.get('email'),
subject = request.POST.get('subject'),
message = request.POST.get('message')
print(name,email,subject,message)
contactform = ContactForm(name=name, email=email, subject=subject, message=subject)
contactform.save()
messages.success(request,"Message sent successfully")
send_mail(
f'message :{email}, {subject}', #subject
message, #message
' masteregntility5@gmail.com', #from email
['douglaschiemela@gmail.com'], #To email
fail_silently=False
)
# email = EmailMessage(f'message from: {contactform.name}', f'body:{contactform.subject}, of {contactform.message}', to=['mastergentility5@gmail.com'])
# email.send()
# return HttpResponseRedirect('/')
this is my views.py
EMAIL_HOST = 'smpt.gmail.com'
EMAIL_PORT = '587'
EMAIL_HOST_USER = [os.environ.get("EMAIL_HOST_USE")]
EMAIL_HOST_PASSWORD = [os.environ.get("EMAIL_HOST_PASSWOR")]
EMAIL_USE_TLS = True
and this is the settings.py