Updated reset pin function to send mail