472,328 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

smtplib error('Connection reset by peer')

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:
import smtplib
server = smtplib.SMTP('localhost')
server.sendmail('s*********@example.org', 'j******@example.org', """To: jc*****@example.org
From: so********@example.org

Beware the Ides of March.
""") server.quit()


I should be able to send an email to the recipient, in this case
jc*****@example.org? When I try to create the server(the line 'server =
smtplib.SMTP('localhost')) I get the following error message:

Traceback (most recent call last):
File "<pyshell#1>", line 1, in -toplevel-
server = smtplib.SMTP('localhost')
File "C:\Python24\lib\smtplib.py", line 241, in __init__
(code, msg) = self.connect(host, port)
File "C:\Python24\lib\smtplib.py", line 304, in connect
(code, msg) = self.getreply()
File "C:\Python24\lib\smtplib.py", line 345, in getreply
line = self.file.readline()
File "C:\Python24\lib\socket.py", line 340, in readline
data = self._sock.recv(self._rbufsize)
error: (10054, 'Connection reset by peer')

Anyone got a pointer as to what I could do?

Jan 4 '06 #1
3 4176
I should mention that I'm on Windows XP.

Jan 5 '06 #2
Do you actually run an SMTP server on your local machine and is it
configured to accept mail on the localhost interface and does it allow
mail forwarding such as you attempted?

LL

Jan 7 '06 #3
"Van_Gogh" <Te*****@gmail.com> wrote:

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:
import smtplib
server = smtplib.SMTP('localhost')
server.sendmail('s*********@example.org', 'j******@example.org',"""To: jc*****@example.org
From: so********@example.org

Beware the Ides of March.
""") server.quit()


I should be able to send an email to the recipient, in this case
jc*****@example.org? When I try to create the server(the line 'server =
smtplib.SMTP('localhost')) I get the following error message:
...
error: (10054, 'Connection reset by peer')

Anyone got a pointer as to what I could do?


Replace "localhost" with the name of your usual outgoing mail server.

Although there ARE SMTP servers available for Windows XP, is it virtually
certain that you aren't running one.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jan 8 '06 #4

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

Similar topics

0
by: EarthlingZ | last post by:
Hello I have a problem with my search engien, the point with it that I can find a special word in my tabel. Like if I have added in my tabel PHP...
0
by: Thomas Andersson | last post by:
Hi all - I have a problem which is driving me insane. I've been using VS.NET 2003 on my computer for 6 month with no problems but now I suddenly get...
2
by: windu | last post by:
I made a form and when i press F5 show a message "network error connection". what is wrong with my access. can anyone help me?
1
by: niceyama | last post by:
Dear c.l.p, I have recently been doing the tutorial of Python and everything is well, i'm upto the pass section. Anyway, when I try to launch...
1
by: ccdsj | last post by:
Can anyone help with the problem below? Thanks. ----------------------------------- Dear All, I was attempting to open up one of my Web...
2
by: Vania | last post by:
Hi, I'm not sure this is the proper forum but I try nevertheless. The problem I'am facing is that the socket library always fail to connect to an...
3
rhitam30111985
by: rhitam30111985 | last post by:
hi all,,, i am testing a web crawler on a site passsed as a command line argument.. it works fine until it finds a server which is down or some other...
2
by: cirfu | last post by:
The first time i start the shell it always works. But often after closing it and restarting it I get: Two windows pops up and the shell, after...
1
by: cnivas | last post by:
Hi, I'm doing a small project on Python using MySQL as Database in MAC OS X. I was unable to connect the database. I was downloaded MySQLdb from...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...

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.