smtplib.SMTP() line. It doesn't works from home but not from work. What's
the best way to debug this?
# Here's my script
import smtplib
msg = "Subject: Hello\n\nThis is the\nbody of the message."
server = smtplib.SMTP("s mtp.gmail.com", 465)
# "Connection refused" normally means there is no server listening for
# connections on the specified IP/port-combination.
# use netstat -an to view connections.
server.set_debu glevel(1)
server.ehlo()
server.starttls ()
server.ehlo()
# !!! set the password
server.login("m yuser", "mypass")
server.sendmail ("...
# Here's the error
Traceback (most recent call last):>>server = smtplib.SMTP("s mtp.gmail.com", 465)
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/smtplib.py", line 241, in __init__
(code, msg) = self.connect(ho st, port)
File "/usr/lib/python2.4/smtplib.py", line 304, in connect
(code, msg) = self.getreply()
File "/usr/lib/python2.4/smtplib.py", line 345, in getreply
line = self.file.readl ine()
File "/usr/lib/python2.4/socket.py", line 340, in readline
data = self._sock.recv (self._rbufsize )
socket.error: (113, 'Software caused connection abort')