Unread email notifier, most practical approach
- by Michael Pasqualone
I'm in the process of writing a small php-cli script that will loop over over my personal inbox and then send me an SMS via a gateway.
The question I have is:
As will have the script launch via cron every 10 minutes, if there is an email sitting in my inbox that is not read before the next script launch then I will receive 2 sms.
Does any one (pseudocode will do) have any idea what the best practice would be in php5 to ensure only 1 SMS is sent?
What I am currently learning towards is towards storing the message ID in a sqlite DB and flagging a field whether an SMS has been sent or not - but wondering if there is an easier way?