You should use cron jobs.
First, you must create a php script whose look if there is any email to be sent (it can be a simple php file that get the time and that compare it with a timestamp in your database, then get info about the email you want to send, compose the email with your headers, subject and body and finish it by sending it.)
Second you must execute it in shell (I assume you're working with a Linux system) to test if it is working ok. To execute a php in shell you can use the next command
php /route/to/your/php/script.php var1 var2 .... varN
Maybe the command php could not work so you must to know which php client you have installed (very important, you must first have installed a php client in your system -- apt-get install php5-cli). You can know which php have you installed in your system typing the next in a shell
which php
You will find more information about how to exec php in shell in the url Shell run/execute php script with parameters
And the third thing you must to do is to program the script in cronjob. For example, if you want to execute it in 5 minutes intervals you could write the next in your cron (crontab -e)
*/5 * * * * php /route/to/your/php/script.php var1 var2 > /dev/null
Or
*/5 * * * * /usr/bin/php /route/to/your/php/script.php var1 var2 > /dev/null
You have other option to make a php an exec file and so you mustn't use php before your script and it's to add the next line before you open your php
#!/usr/bin/php
<?php