session.starttls()
session.login('youremail@gmail.com', ' password')
headers = '\r\n'.join(['from: ' + 'youremail@gmail.com', 'subject: ' +
    'test', 'to: ' + 'contactemail@gmail.com', 'mime-version: 1.0',
    'content-type: text/html'])
content = headers + '\r\n\r\n' + 'body_of_email'
session.sendmail('youremail@gmail.com', 'contactemail@gmail.com', content)
How to send mail with Python