Below is sample code for sending email through Gmail using Python
import smtplib; fromaddr = 'email@gmail.com' toaddrs = 'email@gmail.com' msg = 'My first email message from Python' username = 'email@gmail.com' password = '###' server = smtplib.SMTP('smtp.gmail.com:587') server.starttls() server.login(username,password) server.sendmail(fromaddr, toaddrs, msg) server.quit()