我正在尝试使用以下代码发送电子邮件:
s = smtplib.SMTP("smtp.live.com",587, timeout=120)
s.ehlo()
s.starttls()
s.ehlo()
s.login(user, pass)
msg["To"] = string.joinfields(bundle, ", ")
s.sendmail(usuario, bundle, msg)
但是我收到以下错误:
File "C:\Python27\lib\smtplib.py", line 242, in __init__
(code, msg) = self.connect(host, port)
File "C:\Python27\lib\smtplib.py", line 302, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "C:\Python27\lib\smtplib.py", line 277, in _get_socket
return socket.create_connection((port, host), timeout)
File "C:\Python27\lib\socket.py", line 571, in create_connection
raise err
error: [Errno 10060] A connection attempt failed because the connected party did
not properly respond after a period of time, or established connection failed b
ecause connected host has failed to respond
我做错了什么?