Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- Sending an email in Python to use with IFTTT (and Wiimotes).
- Modified from the following address: http://www.averagemanvsraspberrypi.com/2013/09/make-your-raspberry-pi-tweet-its.html
- '''
- import smtplib
- from email.mime.text import MIMEText
- # Set up the email information.
- # Note: If you use an IFTTT recipe that is triggered by regular email instead of GMail,
- # then send the email to trigger@recipes.ifttt.com (trigger@ifttt.com is no longer used).
- From = "CMPT380@gmail.com"
- Password = "GoLlamas"
- To = "CMPT380@gmail.com" # "trigger@recipes.ifttt.com"
- Body = "This is the body"
- Subject = "This is the subject"
- Subject = "Wiimote has been picked up!"
- msg = MIMEText(Body)
- msg['From'] = From
- msg['To'] = To
- msg['Subject'] = Subject
- server = smtplib.SMTP('smtp.gmail.com:587')
- server.ehlo_or_helo_if_needed()
- server.starttls()
- server.ehlo_or_helo_if_needed()
- server.login(From,Password)
- server.sendmail(From, To, msg.as_string())
- server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement