gaierror [Errno 8] when send_mail with Django python and gmail

DreeOlee

I'm new with Django an Python. I was following this tutorial "Try Django 16" I don't get it work. I added fail_silent=false to get the error.

[Errno 8] nodename nor servname provided, or not known

Is there anyone who can help me find this problem?

gaierror at /thank-you/
[Errno 8] nodename nor servname provided, or not known
Request Method: POST
Request URL:    http://127.0.0.1:8000/thank-you/
Django Version: 1.6.5
Exception Type: gaierror
Exception Value:    
[Errno 8] nodename nor servname provided, or not known
Exception Location: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py in create_connection, line 553
Python Executable:  /usr/bin/python
Python Version: 2.7.5
Python Path:    
['/Users/andremensink/Desktop/skillshare/src',
 '/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC',
 '/Library/Python/2.7/site-packages']
Server time:    Sat, 28 Jun 2014 13:23:10 +0000




Environment:


Request Method: POST
Request URL: http://127.0.0.1:8000/thank-you/

Django Version: 1.6.5
Python Version: 2.7.5
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'south',
 'signups')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback:
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
  112.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/andremensink/Desktop/skillshare/src/signups/views.py" in thankyou
  40.         send_mail(subject,message,from_email,to_list,fail_silently=False)
File "/Library/Python/2.7/site-packages/django/core/mail/__init__.py" in send_mail
  50.                         connection=connection).send()
File "/Library/Python/2.7/site-packages/django/core/mail/message.py" in send
  274.         return self.get_connection(fail_silently).send_messages([self])
File "/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py" in send_messages
  87.             new_conn_created = self.open()
File "/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py" in open
  48.                                            local_hostname=DNS_NAME.get_fqdn())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py" in __init__
  250.             (code, msg) = self.connect(host, port)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py" in connect
  310.         self.sock = self._get_socket(host, port, self.timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py" in _get_socket
  285.         return socket.create_connection((host, port), timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py" in create_connection
  553.     for res in getaddrinfo(host, port, 0, SOCK_STREAM):

Exception Type: gaierror at /thank-you/
Exception Value: [Errno 8] nodename nor servname provided, or not known

The code in python is:

#--django stuff
from django.conf import settings
from django.contrib import messages
from django.core.mail import send_mail #EmailMessage#send_mail
from django.shortcuts import render, render_to_response, RequestContext, HttpResponsePermanentRedirect

    subject = 'This is the subject'
    message = 'Welcome to the list and enjoy your product.\n This is the message.'
    from_email = settings.EMAIL_HOST_USER
    to_list = [save_it.email,settings.EMAIL_HOST_USER]
    send_mail(subject,message,from_email,to_list,fail_silently=False)    

in the settings is defined:

#for gmail or google apps
EMAIL_USE_TLS = True
EMAIL_HOST = 'smpt.gmail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587
ACCOUNT_EMAIL_VERIFICATION = 'none'
user710907
EMAIL_HOST = 'smpt.gmail.com'

What is smpt?

should be EMAIL_HOST = 'smtp.gmail.com'

http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

gaierror [Errno 8] when send_mail with Django python and gmail

From Dev

Python Django send_mail newlines?

From Dev

Django send_mail() from EC2 via Gmail gives SMTPAuthenticationError - but works fine in localhost

From Dev

Mail sent using send_mail() [Python - Django] does not send embedded images

From Dev

Mail sent using send_mail() [Python - Django] does not send embedded images

From Dev

Django : send_mail HttpResponseRedirect

From Dev

send_mail not working in django

From Dev

socket.gaierror: [Errno 8] nodename nor servname provided, or not known

From Dev

Send mail in Gmail with python

From Dev

How to test send_mail in Django?

From Dev

gaierror: [Errno 11004] getaddrinfo failed

From Dev

Very slow mail sending with Django send_mail method

From Dev

Django mail_admins vs send_mail

From Java

SMTPAuthenticationError when sending mail using gmail and python

From Dev

Django Broken pipe with send_mail in browser and shell

From Dev

Change send_mail() method to EmailMessage - Django 1.6

From Dev

Django send_mail DNS_NAME error

From Dev

Django Broken pipe with send_mail in browser and shell

From Dev

What does fail_silently do in send_mail() django?

From Dev

socket.gaierror when trying to run emr using python mrjob

From Dev

Gmail SMTPAuthenticationError when I attempt to send email via django

From Dev

socket.gaierror: Errno 11004 getaddrinfo failed

From Dev

How to make send_mail function send bcc emails - Django REST API

From Dev

Django send_mail fails in 1.7 Says no django_smtp_ssl

From Dev

Python Django Gmail SMTP setup

From Dev

OSError: [Errno 8] Exec format error: 'geckodriver' when trying to open firefox using selenium in python

From Dev

Python - Telnetlib socket.gaierror:

From Dev

Send e-mail to Gmail with inline image using Python

From Dev

Windows 8 Mail app doesn't work with Gmail when 2-step verification is enabled

Related Related

  1. 1

    gaierror [Errno 8] when send_mail with Django python and gmail

  2. 2

    Python Django send_mail newlines?

  3. 3

    Django send_mail() from EC2 via Gmail gives SMTPAuthenticationError - but works fine in localhost

  4. 4

    Mail sent using send_mail() [Python - Django] does not send embedded images

  5. 5

    Mail sent using send_mail() [Python - Django] does not send embedded images

  6. 6

    Django : send_mail HttpResponseRedirect

  7. 7

    send_mail not working in django

  8. 8

    socket.gaierror: [Errno 8] nodename nor servname provided, or not known

  9. 9

    Send mail in Gmail with python

  10. 10

    How to test send_mail in Django?

  11. 11

    gaierror: [Errno 11004] getaddrinfo failed

  12. 12

    Very slow mail sending with Django send_mail method

  13. 13

    Django mail_admins vs send_mail

  14. 14

    SMTPAuthenticationError when sending mail using gmail and python

  15. 15

    Django Broken pipe with send_mail in browser and shell

  16. 16

    Change send_mail() method to EmailMessage - Django 1.6

  17. 17

    Django send_mail DNS_NAME error

  18. 18

    Django Broken pipe with send_mail in browser and shell

  19. 19

    What does fail_silently do in send_mail() django?

  20. 20

    socket.gaierror when trying to run emr using python mrjob

  21. 21

    Gmail SMTPAuthenticationError when I attempt to send email via django

  22. 22

    socket.gaierror: Errno 11004 getaddrinfo failed

  23. 23

    How to make send_mail function send bcc emails - Django REST API

  24. 24

    Django send_mail fails in 1.7 Says no django_smtp_ssl

  25. 25

    Python Django Gmail SMTP setup

  26. 26

    OSError: [Errno 8] Exec format error: 'geckodriver' when trying to open firefox using selenium in python

  27. 27

    Python - Telnetlib socket.gaierror:

  28. 28

    Send e-mail to Gmail with inline image using Python

  29. 29

    Windows 8 Mail app doesn't work with Gmail when 2-step verification is enabled

HotTag

Archive