Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import time
- import smtplib
- import RPi.GPIO as GPIO
- GPIO.setmode(GPIO.BCM)
- GPIO.setup(25, GPIO.IN)
- GPIO.input(25)
- while True:
- if not GPIO.input(25):
- fromaddr = 'dautente@gmail.com'
- toaddrs = 'autente@gmail.com'
- #Aggiungo i dati per l'invio
- username = 'utente' #inserire proprio indirizzo
- password = 'password' #inserire propria password
- server = smtplib.SMTP('smtp.gmail.com:587')
- server.starttls()
- server.login(username, password)
- server.sendmail(fromaddr, toaddr, msg)
- server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement