sending gmail though your python code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #Sending an email through gmail using Python - Raghuram Reddy
import smtplib
fromaddr = 'raghuramgreddy@gmail.com'
toaddrs = 'raghuramgreddy@gmail.com'
msg = 'Email message from PYTHON Raghuram app'
#provide gmail user name and password
username = 'gmailUserName'
password = 'gmailPassword'
# functions to send an email
server = smtplib.SMTP('smtp.gmail.com:587')
server.ehlo()
server.starttls()
server.ehlo()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()
|
Tags: python_scripts
See also (other recipes talking to gmail): http://code.activestate.com/search/recipes/#q=gmail
Thanks! I had a lot of fun playing around with this code.
Please change the email if you are using this code to avoid spam.
Thanks, Raghuram Reddy Gottimukkula
"10060 views for this recipe???". Inspired to post more.
thanks