smtplib (111, 'Connection refused')

Josh Close narshe at
Fri Sep 17 22:58:10 CEST 2004

import smtplib

mail = smtplib.SMTP('localhost')
mail.send('me','user at domain.tld','message goes here')

but this fails at the smtplib.SMTP() line on one box, but not on another.


On Fri, 17 Sep 2004 16:17:47 -0400, phansen <peter at> wrote:
> Josh Close wrote:
> > I'm using the smtplib module and I keep getting this error: (111,
> > 'Connection refused') What could be causing this? I've tried it from a
> > different computer and it seems to work, but not from this specific
> > server. If port 25 was blocked for some reason, would that give me a
> > 'connection refused' error?
> Please show a snippet of the code you are using, so we can
> see what you are trying to do here.
> --

More information about the Python-list mailing list