Socket Timeout and SMTP

Steve lonetwin at gmail.com
Fri Jul 23 07:40:53 EDT 2004


Hi Tim,
On Fri, 23 Jul 2004 12:35:03 +0100, Tim Williams <listserver at tdw.net> wrote:
> (python newbie)
> 
> Is it possible to individually set the socket timeout of a connection
> created by smtplib,  rather than use the socket.setdefaulttimeout() value
> used by the rest of the prog/script?
> def smtp_client(mx, from, to_list, msg):
>     server = smtplib.SMTP(mx)
       server.sock.settimeout(XX)

HTH
Steve



More information about the Python-list mailing list