473,322 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

smtplib (111, 'Connection refused')

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?

-Josh
Jul 18 '05 #1
8 8872
Josh Close <na****@gmail.com> writes:
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?


Yes. When in doubt, try telnet <host> <port>.
--
Chris Green <cm*@dok.org>
Fame may be fleeting but obscurity is forever.
Jul 18 '05 #2
Josh Close wrote:
I'm using the smtplib module and I keep getting this error: (111,
'Connection refused') What could be causing this?


This means there is no SMTP server running on the remote system.
However, there *is* a TCP implementation (typically the operating
system) on the other end that tells you port 25 is not being
listened to.

Regards,
Martin
Jul 18 '05 #3
Does smtplib even use a smtp server? I looked at the source and it
looks like it just connects via a socket and sends like that.

-Josh
On Fri, 17 Sep 2004 21:52:23 +0200, Martin v. Löwis <ma****@v.loewis.de> wrote:
Josh Close wrote:
I'm using the smtplib module and I keep getting this error: (111,
'Connection refused') What could be causing this?


This means there is no SMTP server running on the remote system.
However, there *is* a TCP implementation (typically the operating
system) on the other end that tells you port 25 is not being
listened to.

Regards,
Martin


--
http://mail.python.org/mailman/listinfo/python-list

Jul 18 '05 #4
In article <ma**************************************@python.o rg>,
Josh Close <na****@gmail.com> wrote:
Does smtplib even use a smtp server? I looked at the source and it
looks like it just connects via a socket and sends like that.
That's what SMTP is, the protocol to be used on that socket.
Your program is an SMTP client. Where is the SMTP server?

Donn Cave, do**@u.washington.edu
On Fri, 17 Sep 2004 21:52:23 +0200, Martin v. Löwis <ma****@v.loewis.de>
wrote:
Josh Close wrote:
I'm using the smtplib module and I keep getting this error: (111,
'Connection refused') What could be causing this?


This means there is no SMTP server running on the remote system.
However, there *is* a TCP implementation (typically the operating
system) on the other end that tells you port 25 is not being
listened to.

Regards,
Martin

Jul 18 '05 #5
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.
Jul 18 '05 #6
import smtplib

mail = smtplib.SMTP('localhost')
mail.send('me','u***@domain.tld','message goes here')
mail.quit()

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

-Josh
On Fri, 17 Sep 2004 16:17:47 -0400, phansen <pe***@engcorp.com> 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.
--
http://mail.python.org/mailman/listinfo/python-list

Jul 18 '05 #7
Josh Close wrote:
import smtplib

mail = smtplib.SMTP('localhost')
mail.send('me','u***@domain.tld','message goes here')
mail.quit()

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


OK, so you have an SMTP server on one box but not another. Either
install an SMTP server on another box, or connect to "one box" on
both boxes, instead of connecting to "localhost" on either.

Regards,
Martin
Jul 18 '05 #8
----- Original Message -----
From: "Josh Close" <na****@gmail.com>

import smtplib

mail = smtplib.SMTP('localhost')
mail.send('me','u***@domain.tld','message goes here')
mail.quit()

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


You either only have an SMTP server running on one box (the successful one),
or localhost isn't configured properly on the failing machine

Jul 18 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Hughes | last post by:
I wonder if anyone can help me resolve this problem. Although my ISP (One and One) provides the facility to run Python 2.2 CGI programs, their technical support people don't seem to have any Python...
3
by: yazzoo | last post by:
Does anyone know what causes an SMTPLIB DataError? The only thing I can find in the manual is exception SMTPDataError The SMTP server refused to accept the message data. My problem is a...
8
by: dccarson | last post by:
Here is a snippet of code which does not send to all recipients. However, it also does not inform me of this error. My suspicion is that this only fails for users with longer usernames. The two I...
0
by: Tim Williams | last post by:
I have a working SMTP client that I need to add TLS capability to, I absolutely need the client to timeout within a specified time, but when I use the sock.timeout() line it freezes the reading...
3
by: Van_Gogh | last post by:
Hi, I am learning how to use the smtplib module, but am having some very early problems, maybe because I don't understand it. So, am I correct that by following the example in the Python: >>>...
1
by: erikcw | last post by:
Hi, I'm trying to send an email message with python, and I'm getting this error: Traceback (most recent call last): File "wa.py", line 430, in ? main() File "wa.py", line 425, in main...
0
by: devtalex | last post by:
hello all!... i'm novice here... I've such kind of issue. The purpose of my code is to copy a number of files by FTP (using different ports every time). There are different numbers of files...
0
by: lesmith | last post by:
db2 governor failing with connection refused -------------------------------------------------------------------------------- We are trying to test using the db2 governor (udb v8) and get a...
5
by: zxo102 | last post by:
Hi, I am trying to use python module smtplib to send my email out on window xp (localhost). import smtplib server = smtplib.SMTP('localhost') but I got the error information as follows: ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.