gaierror at / [Errno 11001] getaddrinfo failed

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

I noticed you have a typo in your settings:

# it's smtp not smpt
EMAIL_HOST = 'smtp.gmail.com'

thanks very much that really helped… but i got another one after that


here is it please help

I think you didn’t set the app password in your Google Account settings, so go to the security section of your account and set it and use this password in django settings.

EMAIL_HOST_PASSWORD = 'your app password'
# or set it in your environment