469,306 Members | 1,557 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

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 3682
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by windu | last post: by
1 post views Thread by niceyama | last post: by
2 posts views Thread by Vania | last post: by
2 posts views Thread by cirfu | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.