To send email using SMTP
import smtplib content="HelloWorld" mail=smtplib.SMTP('smtp.gmail.com',587) mail.ehlo()#identifies the server mail.starttls()#starts TLS mode sender='sender email address' recipient="recepient Email address" mail.login(sender,'password') header='To:'+recipient+'\n'+'From:'\ +sender+'\n'+'subject:testmail\n' content=header+content mail.sendmail(sender,recipient, content)#sending actual mail mail.close() ''' https://myaccount.google.com/lesssecureapps enable the below menu '''