Python and Arduino code to send an email on a digital pin state change