[Tutor] Sending email from PC

pan@uchicago.edu pan@uchicago.edu
Thu May 8 15:45:02 2003


Hi all,

I'm trying to setup something such that I can use my browser
to run some cgi (pythong based, of course) on my localhost
to send emails. 

I've seen some examples from the net using smtplib:

>>> import smtplib
>>> s = smtplib.SMTP('localhost')

But when I tried it on my machine, it always got me this error:

Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "C:\Python22\lib\smtplib.py", line 234, in __init__
    (code, msg) = self.connect(host, port)
  File "C:\Python22\lib\smtplib.py", line 283, in connect
    raise socket.error, msg
error: (10061, 'Connection refused')

How can I configure my pc for this task?

I've seen there's a 'sendmail.dll' in my "c:/winnt/win32" folder.
Is that something to do with the sendmail function of the local
host?

pan