This topic is locked

timer to send emails , based on database record

1/21/2009 8:08:55 PM
PHPRunner General questions
S
sinan author

Hi,
I need to write a code to send an email based on a record in the db, the record will look like that
email.address--email.title--email.body--time.to.send
so, the system will send an email to "email.address" with "email.body", at certain time "time.to.send"
how can trigger php to go to the table at "time.to.send" and make this action?I need the code please?

J
Jane 1/23/2009

Hi,
You need to use external scheduler like CRON for this purpose.
Write a script that checks the date and sends an email. Use cron to run this script on timely fashion i.e. once a day.

S
sinan author 1/31/2009

Hi,

You need to use external scheduler like CRON for this purpose.
Write a script that checks the date and sends an email. Use cron to run this script on timely fashion i.e. once a day.


Thanks Jane!

I used this code and it worked

<?

exec("crontab /home/admin/domain.com/public_html/testing/crontab.dat";);

?>

W
wildwally 2/1/2009



Thanks Jane!

I used this code and it worked

<?

exec("crontab /home/admin/domain.com/public_html/testing/crontab.dat";);

?>


Where did you use that code, any further explanationw qould be greatly appreciated.