9/09/2016

Python :: python send email gmail One User recipient.

Python :: python send email gmail One User recipient.
1. Code
  1. import smtplib
  2.  
  3. fromaddr = 'fromuser@gmail.com'
  4. toaddrs  = 'touser@gmail.com'
  5. msg = 'There was a terrible error that occured and I wanted you to know!'
  6.  
  7.  
  8. # Credentials (if needed)
  9. username = 'username'
  10. password = 'password'
  11.  
  12. # The actual mail send
  13. server = smtplib.SMTP('smtp.gmail.com:587')
  14. server.starttls()
  15. server.login(username,password)
  16. server.sendmail(fromaddr, toaddrs, msg)
  17. server.quit()

Example :: https://www.nixtutor.com/linux/send-mai ... th-python/

No comments:

Post a Comment