Before getting a new smartphone, I had a razor phone, which could get SMS messages, but not web. This script checks an email account via POP3, and checks the most recent 10 messages. These messages are compared to the messages noted in the MySQL database, if there are any new messages, a small notification is emailed to my phone using an “SMS gateway”, which is an email address such as: email@example.com. Most cell carriers have some sort of gateway address for forwarding from email to SMS.
Upon a new email, I would be presented with a text telling me which account to check who it’s from, and the subject. It was run from CRON every 10 minutes, like so:
./checkem.pl address@toCheck.com myEmailPassword pop.gmail.com firstname.lastname@example.org