Hey guys,
I wanted to make a simple Python program to send an email to my Gmail account. So:
import smtplib
sobj=smtplib.SMTP("smtp.gmail.com")
sender="sravan953@gmail.com"
rec="sravan953@gmail.com"
msg="""
From: From Person<sravan953@gmail.com>
To: To Person<sravan953@gmail.com>
Subject: Test
Does it work?
"""
sobj.sendmail(sender,rec,msg)
-but it doesn't work, it shows an error
Traceback (most recent call last):
File "<pyshell#14>", line 1, in <module>
smtpobj.sendmail(sender,rec,msg)
File "C:\Python26\lib\smtplib.py", line 698, in sendmail
raise SMTPSenderRefused(code, resp, from_addr)
SMTPSenderRefused: (530, '5.7.0 Must issue a STARTTLS command first. m25sm8001489waf.9', 'sravan953@gmail.com')
What's wrong and what is happening?
Thanks a lot guys!