473,587 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

smtplib error('Connecti on 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('l ocalhost')
server.sendmail ('s*********@ex ample.org', 'j******@exampl e.org', """To: jc*****@example .org
From: so********@exam ple.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('l ocalhost')) I get the following error message:

Traceback (most recent call last):
File "<pyshell#1 >", line 1, in -toplevel-
server = smtplib.SMTP('l ocalhost')
File "C:\Python24\li b\smtplib.py", line 241, in __init__
(code, msg) = self.connect(ho st, port)
File "C:\Python24\li b\smtplib.py", line 304, in connect
(code, msg) = self.getreply()
File "C:\Python24\li b\smtplib.py", line 345, in getreply
line = self.file.readl ine()
File "C:\Python24\li b\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 4378
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('l ocalhost')
server.sendmail ('s*********@ex ample.org', 'j******@exampl e.org',"""To: jc*****@example .org
From: so********@exam ple.org

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


I should be able to send an email to the recipient, in this case
jc*****@exampl e.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
1929
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 the tabel when I search on sux or and. I use MySQL 4.1.13 (xampp) http://www.apachefriends.org/ I have the Key: in the tabel (or what its...
0
1222
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 new asp.net project or open existing asp.net projects: "the web server reported the following error when attempting to create or open the web...
2
1799
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
3013
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: Connection Refused. I do not have a firewall, so I don't know what is going on. Also, this comes up after it: IDLE's subprocess didn't make the...
1
1264
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 server reported the following error when
2
9148
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 setuptools. I'm using Python2.4 on a windows XPPRO Sp2 machine. The firewall is disabled. There is no NLTM proxy. I connect to the internet through a NAT...
3
4637
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: #! /usr/bin/python import urllib import re import sys def crawl(urllist,done):
2
2307
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 itself. socket error: connection refused IDLE's subprocess didnt make connection.
1
2944
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. After modified and restart the setup.py I'm getting an error "gcc" cannot find the file. This is the error it was getting when I was reinstalling the...
0
7915
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8205
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.