473,404 Members | 2,114 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,404 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 4350
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 RULEZ AND .NET SUX, So should I find this line in...
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 the following error message when I try to create a...
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 idle now I get the error message: Socket Error:...
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 applications when I received this message: The 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 URL. The net effect is that I can not use...
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 error ... here is my code: #!...
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 clicking the windows the shell just closes by...
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 sourceforge.net and I also modified setup_posix.py....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.