Advertisement
Guest User

Untitled

a guest
May 1st, 2017
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. # Allow less secure apps to access your gmail account
  2.  
  3. import email
  4. import smtplib
  5.  
  6. fromaddr = "yourAddress@gmail.com"
  7. toaddr = "toAddress@domain.com"
  8. msg = "Content of your email message."
  9.  
  10. username = "yourGmailAddress"
  11. password = "yourPassword"
  12.  
  13. server.smtplib.SMTP("smtp.gmail.com:587")
  14. server.starttls()
  15. server.login(username, password)
  16. server.sendmail(fromaddr, toaddr, msg)
  17. server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement