Advertisement
Guest User

Untitled

a guest
Oct 19th, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import time
  4. import smtplib
  5. import RPi.GPIO as GPIO
  6. GPIO.setmode (GPIO.BCM)
  7. GPIO.setup (25, GPIO.IN)
  8. GPIO.input(25)
  9. while True:
  10. if GPIO.input(25, 0)
  11.  
  12. fromaddr = 'dautente@gmail.com'
  13. toaddrs = 'autente@gmail.com'
  14. #Aggiungo i dati per l'invio
  15. username = 'utente' #inserire proprio indirizzo
  16. password = 'password' #inserire propria password
  17.  
  18. server = smtplib.SMTP('smtp.gmail.com:587')
  19. server.starttls()
  20. server.login(username,password)
  21. server.sendmail(fromaddr, toaddr, msg)
  22. server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement