[Tutor] confusing smtp problem

nephish nephish at xit.net
Wed Jul 20 18:55:35 CEST 2005


Hey there, i am trying to get an email through an SMTP server on a  
windows computer from a linux machine on the same network.

>>> import smtplib
>>> import MySQLdb
>>> Server = smtplib.SMTP('10.10.10.32')
>>> ToAddress = 'nephish at xit.net'
>>> FromAddress = 'nephish at xit.net.com'
>>> Message = 'Some text message'
>>> Server.sendmail(FromAddress, ToAddress, Message)
{}

but nothing goes through,
now if i do this...
>>> Server.connect()

i get this

Traceback (innermost last):
   File "<stdin>", line 1, in ?
   File "/usr/lib/python2.3/smtplib.py", line 303, in connect
     (code, msg) = self.getreply()
   File "/usr/lib/python2.3/smtplib.py", line 347, in getreply
     raise SMTPServerDisconnected("Connection unexpectedly closed")
SMTPServerDisconnected: Connection unexpectedly closed

now if i use the server on this computer ('localhost')
everything works ok.

any ideas?
thanks,
<><



More information about the Tutor mailing list