christo16 Posted February 10, 2007 Share Posted February 10, 2007 Hello everybody, I work for a computer shop and have created a php/mysql system that we use to keep track of all the computers we work on. How do I make the system that sends out an email based on when the machines are due to be picked up. It would need to be running all the time, not just send out the email when the user accesses the page with the email code on it. Thank you for any input! Quote Link to comment https://forums.phpfreaks.com/topic/37943-automatic-email-reminders/ Share on other sites More sharing options...
SweetLou Posted February 10, 2007 Share Posted February 10, 2007 I'm not sure how you have things set up, but you could just write a script that checks for a date and time that the email should be sent, then just use a cronjob to run the script however often you need it. For example, if you will be sending emails out once a day, you could just run the script once a day also, looking for emails that need to be sent that day. I would probably have the script look for all records that the email send date is older than now, send all of those emails. I would also have a field for emails already sent, so that the SQL would look for all dates older than now, and the email sent field is false. Once the email is sent, then update the email sent field. Of course, you could make this as complicated as you want. For example, if an email was sent and the user didn't get the computer in 3 days, another email is sent, etc. Quote Link to comment https://forums.phpfreaks.com/topic/37943-automatic-email-reminders/#findComment-181614 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.