I did something recently along similar lines:
I have procmail installed on my server, and that runs a Perl script (but could be php if necessary) which reads the mailbox looking for a certain to: email address. when it finds one, it sends an SMS message to a the number in the subject line. There's a lot of stuff out there which will help you:
www.google.com and search for procmail (for info on how to run a script when an email arrives)
and then read the php manual for info about mysql (if u don't already know).
Dave