[Tutor] Sending email from PC

Jeff Shannon jeff@ccvcorp.com
Thu May 8 17:08:02 2003


pan@uchicago.edu wrote:

> 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. [...]
>
> 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')


The trick here is that you need to be connecting to an active SMTP
server. Odds are good that you're not running your own SMTP server on
your local machine, so you need to find out what your current primary
SMTP server is (try checking the settings of your normal email program)
and use that name in place of "localhost".

If, by some chance, you *are* running an SMTP server, then you'd
probably need to check the configuration of that server to see why it
might be refusing connections.

Jeff Shannon
Technician/Programmer
Credit International