Advertisement
Guest User

Sent gmail for python

a guest
Oct 22nd, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. import smtplib
  2. fromaddr = 'sheni_imeili@gmail.com'
  3. toaddrs  = 'visacugzavni_imis_imeili@gmail.com'
  4. msg = msg = "\r\n".join([
  5.   "From: user_me@gmail.com",
  6.   "To: user_you@gmail.com",
  7.   "Subject: Just a message",
  8.   "",
  9.   "Why, oh why"
  10.   ])
  11. username = 'sheni_imeili@gmail.com'
  12. password = 'sheni_password'
  13. server = smtplib.SMTP('smtp.gmail.com:587')
  14. server.ehlo()
  15. server.starttls()
  16. server.login(username,password)
  17. server.sendmail(fromaddr, toaddrs, msg)
  18. server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement