I believe this needs to be done through the OS. If you are using linux, you can schedule a cronjob that will do it. I don't know about windows ( I know it has a scheduler, I just don't know anything about it).
From your cronjob, call wget (or lynx) to access your php page to process the info in the mysql db. That should take care of it.
Im assuming you are using the mail function in php. For this, you will need sendmail (and have the path to sendmail entered properly in php.ini) running on the server. Again, I don't know about windows, sorry.
Hope it helps.