Reputation: 57656
Id like to generate an automatic email at certain times of the week or daily from my website to certain users. i.e at 12am, or 5pm .I'd like an email reminder sent to user [email protected]. Can anyone point me in the right direction. I have read about cronjob but didn't got much information.
Upvotes: 1
Views: 4752
Reputation: 5089
You need to create php script which will do all work (get data to send, get emails list, send data). After that You need to assign this script to schedule in crontab
Upvotes: 0
Reputation: 6602
Do you have shell access to your host? Or does the host have CPanel installed?
If you have shell access, you can run the following command:
crontab -e
Then insert a new line like this:
* 0,17 * * * /path/to/php/executable /path/to/script/which/sends/emails.php
This will call your PHP script every day at hours 0 and 17 (12AM and 5 PM). The email sending should be done in /path/to/script/which/sends/emails.php
Upvotes: 1
Reputation: 439
You are looking in the right direction... A cronjob would suffice. This would allow you to run a php script on a schedule
Start by looking here
Upvotes: 3