[Tutor] sending email via smtplib

Prasad, Ramit ramit.prasad at jpmorgan.com
Mon Nov 19 19:14:07 CET 2012


Saad Javed wrote:
> 
> I don't think using SSL works with hotmail. I tried using:
> 
> smtplib.SMTP_SSL("smtp.live.com", 587)

You need to use port 25 not 587. 
http://windows.microsoft.com/en-US/hotmail/send-receive-email-from-mail-client

> smtplib.login(user, passwd)
> ...
> 
> That gave this error:
> 
> Traceback (most recent call last):
>   File "sendemail.py", line 22, in <module>
>     smtp = smtplib.SMTP_SSL(smtp_srv, 587)
>   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()
> ssl.SSLError: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
> 
	

~Ramit


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  


More information about the Tutor mailing list