notify.py 502 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env python
  2. def notify(message):
  3. import smtplib
  4. with open('./email_login', 'r') as f:
  5. username = f.read()
  6. with open('./email_password', 'r') as f:
  7. password = f.read()
  8. with open('./send_to', 'r') as f:
  9. send_to = f.read()
  10. server = smtplib.SMTP('smtp.gmail.com', 587)
  11. server.starttls()
  12. server.login(username, password)
  13. server.sendmail(username, send_to, message)
  14. server.quit()
  15. # EOF
  16. # vim: set tabstop=4 shiftwidth=4 expandtab :