0

我正在尝试为我的 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] '

对可能出什么问题有任何见解吗?我检查了我的密码和主机的设置,它们看起来很好。

4

0 回答 0