# gaierror at / \[Errno 11001\] getaddrinfo failed

**URL:** <https://forum.djangoproject.com/t/gaierror-at-errno-11001-getaddrinfo-failed/14478>\
**Category:** Mystery Errors\
**Created:** [June 26, 2022, 6:47am UTC](https://forum.djangoproject.com/t/gaierror-at-errno-11001-getaddrinfo-failed/14478 "2022-06-26T06:47:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gentility01](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gentility01/32/7790_2.png) [@Gentility01](https://forum.djangoproject.com/u/Gentility01)\
**Post date:** [June 26, 2022, 6:47am UTC](https://forum.djangoproject.com/t/gaierror-at-errno-11001-getaddrinfo-failed/14478/1 "2022-06-26T06:47:38Z")

</div>

i am trying to send contact form using email and am having this error

 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/c/c3794296de52dff5fb26025c98020ced994820c3.png)

# gaierror at /

[Errno 11001] getaddrinfo failed

```auto
  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

```auto
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

---

<div class="post-metadata">

**Author:** ![faresi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/faresi/32/8719_2.png) [@faresi](https://forum.djangoproject.com/u/faresi)\
**Post date:** [June 26, 2022, 8:01am UTC](https://forum.djangoproject.com/t/gaierror-at-errno-11001-getaddrinfo-failed/14478/2 "2022-06-26T08:01:18Z")

</div>

I noticed you have a typo in your settings:

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

```

---

<div class="post-metadata">

**Author:** ![Gentility01](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gentility01/32/7790_2.png) [@Gentility01](https://forum.djangoproject.com/u/Gentility01)\
**Post date:** [June 26, 2022, 1:31pm UTC](https://forum.djangoproject.com/t/gaierror-at-errno-11001-getaddrinfo-failed/14478/3 "2022-06-26T13:31:17Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/5/5fa8ce992cde87f69297029c4f3068fa8a21d310.png)  
here is it please help

---

<div class="post-metadata">

**Author:** ![faresi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/faresi/32/8719_2.png) [@faresi](https://forum.djangoproject.com/u/faresi)\
**Post date:** [June 27, 2022, 4:50am UTC](https://forum.djangoproject.com/t/gaierror-at-errno-11001-getaddrinfo-failed/14478/4 "2022-06-27T04:50:50Z")

</div>

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.

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

```
