Search code examples
pythongmailraspberry-pigpio

Python How do I toggle a GPIO from my E-mail inbox


so I have set out on a progect to program something to where whenever I get an E-mail it toggles a GPIO to turn on a LED can someone please help me figure out how to toggle the GPIO on my Raspberry Pi. here is what i have so far

import imaplib

mail = imaplib.IMAP4_SSL('imap.gmail.com')

mail.login('[email protected]','mypassword')

Solution

  • According to work with GPIO, there is a project raspberry-gpio-python, a python library that provides access to raspberry-pi GPIO, Find examples here: https://code.google.com/p/raspberry-gpio-python/wiki/BasicUsage

    According to check your email inbox, you can find duplicate questions on StackOverflow, for example have a look at this simple question: Check unread count of Gmail messages with Python