Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from urllib2 import urlopen
- import smtplib
- s=smtplib.SMTP('smtp.gmail.com',587)
- s.starttls()
- s.ehlo()
- # now login as my gmail user
- username='myEmail@gmail.com'
- password='*****************'
- s.login(username,password)
- # the email objects and body
- replyto='myEmail@gmail.com'
- sendto=['myEmail@gmail.com']
- subject='Mail automatisation'
- content="This is a test"
- mailtext='Subject:'+subject+'n'+content
- # send the email
- s.sendmail(replyto, sendto, mailtext)
- rslt=s.quit()
Add Comment
Please, Sign In to add comment