I'm new to python, for my project I need to send mail from python.. I'm getting the following error can someone please help me how to get out of it..
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import smtplib
>>> server=smtplib.SMTP('smtp.gmail.com',587)
>>> server.starttls()
Traceback (most recent call last):
File "C:\Python34\lib\smtplib.py", line 336, in send
self.sock.sendall(s)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
server.starttls()
File "C:\Python34\lib\smtplib.py", line 671, in starttls
self.ehlo_or_helo_if_needed()
File "C:\Python34\lib\smtplib.py", line 569, in ehlo_or_helo_if_needed
if not (200 <= self.ehlo()[0] <= 299):
File "C:\Python34\lib\smtplib.py", line 423, in ehlo
self.putcmd(self.ehlo_msg, name or self.local_hostname)
File "C:\Python34\lib\smtplib.py", line 349, in putcmd
self.send(str)
File "C:\Python34\lib\smtplib.py", line 339, in send
raise SMTPServerDisconnected('Server not connected')
smtplib.SMTPServerDisconnected: Server not connected
>>>