I'm attempting to send a message from my django app via gmail and keep
getting a connection refused error even though I know the parameters
are correct.

settings.py
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = '587'
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'myu...@gmail.com'
EMAIL_HOST_PASSWORD = 'password'

idle command:
send_mail('My First Subject','My First Email Message in
DJango','myu...@gmail.com',['someb...@gmail.com'],fail_silently=False)

I am able to send email through my mail client (Thunderbird).

Any insight on this matter would be greatly appreciated.  Thanks.

********* The error message is below ************

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Library/Python/2.6/site-packages/django/core/mail/__init__.py",
line 61, in send_mail
    connection=connection).send()
  File "/Library/Python/2.6/site-packages/django/core/mail/message.py",
line 251, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/Library/Python/2.6/site-packages/django/core/mail/backends/smtp.py",
line 79, in send_messages
    new_conn_created = self.open()
  File "/Library/Python/2.6/site-packages/django/core/mail/backends/smtp.py",
line 42, in open
    local_hostname=DNS_NAME.get_fqdn())
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/smtplib.py",
line 239, in __init__
    (code, msg) = self.connect(host, port)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/smtplib.py",
line 295, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/smtplib.py",
line 273, in _get_socket
    return socket.create_connection((port, host), timeout)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.py",
line 512, in create_connection
    raise error, msg
error: [Errno 61] Connection refused


-- 
Scott

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to