Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: sending of mail (smtp) - connection refused - but smtp serveris running!

Reply
Thread Tools

RE: sending of mail (smtp) - connection refused - but smtp serveris running!

 
 
Raaijmakers, Vincent \(GE Infrastructure\)
Guest
Posts: n/a
 
      06-29-2004
run a "netstat -an' on the server and look for what ip address port 25 is open. Perhaps it is on 127.0.0.1 (localhost) instead of 192.168.1.105

Vincent


-----Original Message-----
From: python-list-bounces+vincent.raaijmakers=(E-Mail Removed)
[mailtoython-list-bounces+vincent.raaijmakers=(E-Mail Removed)]On
Behalf Of Alex Hunsley
Sent: Tuesday, June 29, 2004 10:27 AM
To: http://www.velocityreviews.com/forums/(E-Mail Removed)
Subject: sending of mail (smtp) - connection refused - but smtp server
is running!


I am using the smtp module to send emails via a local SMTP server on our network.
I am failing with "connection refused" error, even though we definitely have an
smtp server running on port 25!

the code is like this:


me = '(E-Mail Removed)'
you = '(E-Mail Removed)'
msg['Subject'] = '*** alert'
msg['From'] = me
msg['To'] = you

s = smtplib.SMTP('192.168.1.105')
s.connect()
s.sendmail(me, [you], msg.as_string())
s.close()

print "Email sent."

When I run this code, I get:


Traceback (most recent call last):
File "C:\Python23\check.py", line 58, in -toplevel-
s.connect()
File "C:\Python23\lib\smtplib.py", line 302, in connect
raise socket.error, msg
error: (10061, 'Connection refused')


here's me verifying that SMTP server is indeed alive at port 25 on my local
network:

$ telnet 192.168.1.105 25
Trying 192.168.1.105...
Connected to 192.168.1.105.
Escape character is '^]'.
220 grain.companyname.com ESMTP Server FTGate
helo
250 grain.companyname.com


any ideas what the problem could be? this usually happens when someone is not
aware they have to run an SMTP server, but we do have one running, as can be
seen above!

thanks
alex

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
smtp error: unable to connect to remote server...No connection could be made because the target machine actively refused it Homer ASP .Net 2 08-13-2007 05:39 PM
pls help me when i sent mail, it vil sending twice instead of once ,am using java.mail,am sending my code.... shailajabtech@gmail.com Java 0 09-28-2006 06:38 AM
Sending SMTP mail when SMTP server is unavailable matthewjbarr@gmail.com Java 3 01-24-2006 06:53 PM
connection refused using smtp matamoscas Java 4 09-07-2005 01:05 PM
sending of mail (smtp) - connection refused - but smtp server isrunning! Alex Hunsley Python 4 06-29-2004 04:30 PM



Advertisments