how to use smtp starttls() encryption?

Xu, C.S. xucs007 at yahoo.com
Fri Nov 1 20:37:17 EST 2002


Gerhard,

You saved me! Why don't I need s.login(fromEmail, password) 
to identify myself after s.starttls() ?

Earlier when our mail server don't require TLS, it need
check mail before sending out, or use s.login(fromEmail, password)
to identify myself.

What the hell s.starttls() is doing? There just no slightest clue
in python lib reference.

Thank you, and Martin, and all -- my confidence toward Python
just restored to 95%, :-)

-- ChangSen Xu


> Seems to work:
> 
> gerhard at gargamel:~$ python
> Python 2.2.2 (#1, Oct 18 2002, 03:24:30)
> [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import smtplib
> >>> s = smtplib.SMTP("mail.offleasecomputer.net")
> >>> s.starttls()
>  (220, 'OpenSSL/0.9.5beta go ahead')
> >>> s.sendmail("gerhard.haering at gmx.de", ["testpythonsmtp at offleasecomputer.net"
> ], "hello, does it work?")
> {}
> >>> s.quit()
> 
> -- Gerhard



More information about the Python-list mailing list