[Tutor] sending email via smtplib

Saad Javed sbjaved at gmail.com
Tue Nov 20 05:30:55 CET 2012


Using port 25 with SMTP_SSL gives:

Traceback (most recent call last):
  File "sendemail.py", line 22, in <module>
    smtp = smtplib.SMTP_SSL(smtp_srv, 25)
  File "/usr/lib/python2.7/smtplib.py", line 776, in __init__
    SMTP.__init__(self, host, port, local_hostname, timeout)
  File "/usr/lib/python2.7/smtplib.py", line 249, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib/python2.7/smtplib.py", line 309, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/lib/python2.7/smtplib.py", line 782, in _get_socket
    new_socket = ssl.wrap_socket(new_socket, self.keyfile, self.certfile)
  File "/usr/lib/python2.7/ssl.py", line 381, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 143, in __init__
    self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 305, in do_handshake
    self._sslobj.do_handshake()
socket.error: [Errno 104] Connection reset by peer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121120/8c950ceb/attachment.html>


More information about the Tutor mailing list