Guest User

Untitled

a guest
May 7th, 2018
561
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. password='*****************'
  9. s.login(username,password)
  10.  
  11. # the email objects and body
  12. subject='Mail automatisation'
  13. content="This is a test"
  14. mailtext='Subject:'+subject+'n'+content
  15.  
  16. # send the email
  17. s.sendmail(replyto, sendto, mailtext)
  18.  
  19. rslt=s.quit()
Add Comment
Please, Sign In to add comment