sending of mail (smtp) - connection refused
sending of mail (smtp) - connection refused - but smtp server is running!
Tim Williams (gmail) tdwdotnet at gmail.comTue Jun 29 12:30:13 EDT 2004
- Previous message (by thread): creating graphs from lists
- Next message (by thread): sending of mail (smtp) - connection refused - but smtp server is running!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, 29 Jun 2004 15:26:41 +0100, Alex Hunsley <lard at tardis.ed.ac.molar.uk> wrote: > > 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 = 'ahunsley at companyname.com' > you = 'someonelse at companyname.com' > 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') > Try this s = smtplib.SMTP('192.168.1.105') failed = s.sendmail(me, [you], msg.as_string()) s.quit()
- Previous message (by thread): creating graphs from lists
- Next message (by thread): sending of mail (smtp) - connection refused - but smtp server is running!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list