Guest User

Untitled

a guest
May 7th, 2018
555
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. from urllib2 import urlopen
  2. import smtplib
  3. s=smtplib.SMTP('smtp.gmail.com',587)
  4. s.starttls()
  5. s.ehlo()
  6.  
  7. # now login as my gmail user
  8. username='myEmail@gmail.com'
  9. password='*****************'
  10. s.login(username,password)
  11.  
  12. # the email objects and body
  13. replyto='myEmail@gmail.com'
  14. sendto=['myEmail@gmail.com']
  15. subject='Mail automatisation'
  16. content="This is a test"
  17. mailtext='Subject:'+subject+'n'+content
  18.  
  19. # send the email
  20. s.sendmail(replyto, sendto, mailtext)
  21.  
  22. rslt=s.quit()
Add Comment
Please, Sign In to add comment