Hi all, Was trying a small code to send email from a server
import smtplib server = smtplib.SMTP('125.x.x.x.', 465) server.starttls() server.login("t...@xx.com", "xxxx") msg = "TEST MAIL!" server.sendmail("t...@xx.com", "t...@xx.com", msg) server.quit() But getting failed with following error. Couldn't debug the reason why it's happening. Traceback (most recent call last): File "test_email.py", line 3, in <module> server = smtplib.SMTP('125.x.x.x', 465) File "/usr/local/lib/python2.7/smtplib.py", line 256, in __init__ (code, msg) = self.connect(host, port) File "/usr/local/lib/python2.7/smtplib.py", line 317, in connect (code, msg) = self.getreply() File "/usr/local/lib/python2.7/smtplib.py", line 368, in getreply raise SMTPServerDisconnected("Connection unexpectedly closed") smtplib.SMTPServerDisconnected: Connection unexpectedly closed Would like to know your thoughts _______________________________________________ BangPypers mailing list BangPypers@python.org https://mail.python.org/mailman/listinfo/bangpypers