WebFaction
Community site: login faq

I'm trying to configure django to send email, and I tried to set it up with my default email account on webfaction, which is twneale@twneale.webfactional.com. When I try use django.core.mail.send_mail to send a message, I get a "connection refused" error, pasted below.

My settings:

MAIL_HOST = 'smtp.webfaction.com'
EMAIL_HOST_USER = 'twneale'
EMAIL_HOST_PASSWORD = '*********'
DEFAULT_FROM_EMAIL = 'twneale@twneale.webfactional.com'
SERVER_EMAIL = 'twneale@twneale.webfactional.com'

The error:

>>> from django.core.mail import send_mail as sm
>>> sm("test1", "test2", "twneale@twneale.webfactional.com", ["twneale@gmail.com"])
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/twneale/webapps/_7up/lib/python2.7/django/core/mail/__init__.py", line 61, in send_mail
    connection=connection).send()
  File "/home/twneale/webapps/_7up/lib/python2.7/django/core/mail/message.py", line 251, in send
  return self.get_connection(fail_silently).send_messages([self])
File "/home/twneale/webapps/_7up/lib/python2.7/django/core/mail/backends/smtp.py", line 79, in send_messages
  new_conn_created = self.open()
File "/home/twneale/webapps/_7up/lib/python2.7/django/core/mail/backends/smtp.py", line 42, in open
  local_hostname=DNS_NAME.get_fqdn())
File "/usr/local/lib/python2.7/smtplib.py", line 239, in __init__
  (code, msg) = self.connect(host, port)
File "/usr/local/lib/python2.7/smtplib.py", line 295, in connect
  self.sock = self._get_socket(host, port, self.timeout)
File "/usr/local/lib/python2.7/smtplib.py", line 273, in _get_socket
  return socket.create_connection((port, host), timeout)
File "/usr/local/lib/python2.7/socket.py", line 571, in create_connection
  raise err
error: [Errno 111] Connection refused

Are my settings incorrect?

asked 06 Nov '11, 14:14

twneale
5134
accept rate: 0%


You are missing the E for the host. It should be EMAIL_HOST. Otherwise those settings are correct.

If you still have problems, maybe open a support ticket for us to look into it further for you. https://help.webfaction.com

permanent link

answered 06 Nov '11, 16:03

bmeyer71 ♦♦
1.5k3613
accept rate: 33%

edited 06 Nov '11, 16:09

Humiliating! But I love it when there's an easy answer. Thanks so much.

(06 Nov '11, 20:13) twneale
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×260
×41

question asked: 06 Nov '11, 14:14

question was seen: 5,470 times

last updated: 06 Nov '11, 20:13

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM