how to send mail with python using SMTP ?

Jeff Epler jepler at unpythonic.net
Thu Aug 1 11:51:52 EDT 2002


On Thu, Aug 01, 2002 at 08:44:10AM -0700, Alon wrote:
>  Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
>    File "b_t_serv.py", line 390, in send_mail
>      server=smtplib.SMTP('localhost')
>    File "C:\guyw\Python22\lib\smtplib.py", line 234, in __init__
>      (code, msg) = self.connect(host, port)
>    File "C:\guyw\Python22\lib\smtplib.py", line 283, in connect
>      raise socket.error, msg
>  socket.error: (10061, 'Connection refused')
>  
>  I'll appreciate you help.

You are not running a SMTP server on your machine, at least not on the
standard port.  Python cannot connect to a server which is not running,
no matter on what machine.

Jeff




More information about the Python-list mailing list