Hi,
I have tried to send email through python code the code is -
import smtplib
from email.MIMEText import MIMEText
#try:
s = smtplib.SMTP()
s.connect('') # I have given server name of email
s.sendmail("","","test") # i have given from user and send user
print "Succesfull"
s.quit()
#except:
# print "Error in sending mail to receiver:"
But when i execute this script then it gives following error-
Traceback (most recent call last):
File "<pyshell#121>", line 1, in <module>
reload (mail)
File "D:\Pankaj\python\mail.py", line 6, in <module>
s.connect()
File "C:\Python26\lib\smtplib.py", line 295, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "C:\Python26\lib\smtplib.py", line 273, in _get_socket
return socket.create_connection((port, host), timeout)
File "C:\Python26\lib\socket.py", line 512, in create_connection
raise error, msg
error: [Errno 10061] No connection could be made because the target machine actively refused it