0
我正在運行Mac OS X並使用postfix來啓用本地主機。 這是錯誤消息我得到:我試圖通過Python中的'localhost'發送電子郵件,但它一直給我一個「錯誤61」
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 239, in __init__
(code, msg) = self.connect(host, port)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 295, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 273, in _get_socket
return socket.create_connection((port, host), timeout)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 571, in create_connection
raise err
socket.error: [Errno 61] Connection refused
我不想通過端口25發送它,而是使用127.0.0.1(localhost)作爲SMTP。 – Jordan 2011-05-06 02:58:55
我的答案是肯定的。 – 2011-05-06 02:59:41