I developed a site for user registration but I need a functionality that I have never experienced. The functionality I need is to send an email to a user who has just signed up, with a .pdf file attached. After 15 days of registration, an email will be sent automatically to that user. Please guide me how can I do this thing in PHP with a mySQL database.
Asked
Active
Viewed 2.2k times
2 Answers
4
You can use CRON Jobs for this. Create a script and schedule it in your server using cron jobs. http://www.thesitewizard.com/general/set-cron-job.shtml
Most widely used hosting panel is cPanel, you can see a guide here. http://www.greengeeks.com/support/video-tutorials/display.php?tname=cpanel-x3-cronjob Run a PHP file in a cron job using CPanel http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/CronJobs
-
hmmmm, peoples around suggested me the same however, I have found cron jobs are only done in linux based OS and I am doing windows based platform that supports task scheduling so how can I fixed that problem? – user3309779 Feb 14 '14 at 13:33
-
Probably this might help you. http://stackoverflow.com/questions/2491378/cron-jobs-in-php-deployed-in-windows-platform – Bilal Feb 14 '14 at 13:38
-
it's also worth mentioning that each state has a different time vs server time. this might lead to a mismatch. – Sagive Jan 08 '19 at 13:35
1
write your code logic in separate php file apart from your application and try setting Corn job.
How to send emails via cron job usng PHP mysql
http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/