我正在尝试为Pinax应用配置自动电子邮件。
在shell(python manage.py shell
)中,我正在执行以下操作来测试我的电子邮件设置:
>>> send_mail ('Test','Test','myemail@myemail.com',['myemail@myemail.com'])
但是我得到了跟踪回溯:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/myname/Desktop/myenv2/lib/python2.7/site-packages/django/core/mail/__init__.py", line 61, in send_mail
connection=connection).send()
File "/Users/myname/Desktop/myenv2/lib/python2.7/site-packages/django/core/mail/message.py", line 175, in send
return self.get_connection(fail_silently).send_messages([self])
File "/Users/myname/Desktop/myenv2/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 78, in send_messages
new_conn_created = self.open()
File "/Users/myname/Desktop/myenv2/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 41, in open
local_hostname=DNS_NAME.get_fqdn())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 242, in __init__
(code, msg) = self.connect(host, port)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 302, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 277, in _get_socket
return socket.create_connection((port, host), timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 571, in create_connection
raise err
error: [Errno 60] Operation timed out
settings.py
中的我的电子邮件设置如下:
# These are the email settings for sending out confirmation emails, alerts,etc.
DEFAULT_FROM_EMAIL = 'Mysite <myemail@myemal.com>'
EMAIL_USE_TLS = True
EMAIL_HOST = 'box401.bluehost.com'
EMAIL_HOST_USER = 'myemail@myemal.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587
EMAIL_SUBJECT_PREFIX = '[Your Site] '
任何可能出错的洞察力?我检查了我的密码和主机的设置,看起来很好。