Gmail with python's smtplib

You can use smtplib to conect to GMAIL in python 2.5 (and maybe lower version to). like this:

gmailUser = "user@gmail.com"
gmailPassword = "my_secret_password"
 
mailServer = smtplib.SMTP("smtp.gmail.com", 587)
mailServer.ehlo()
mailServer.starttls()
mailServer.ehlo()
mailServer.login(gmailUser, gmailPassword)
mailServer.sendmail(gmailUser, recipient, msg.as_string())
mailServer.close()

where

this one was taken from: Code Comments
and the config option can be found in :gmail help page

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License