Hello, I want to write PHP code to check the first day of every month like if(Y-M-01) but for every month and if true send an email to the client How can i do that? Thank you
You could write PHP script that would send required email and run this script on the first day of month using cron job.
Thank you for your replay Nei but how i could do that?? i didn't use cron job before Can you please tell me how.
Well, for example cron job usually is a part of Cpanel, or you could install cron job manually on your host, or you could ask support of your host to install cron.
Then you code the php-script that would send required email...or search similar script on the internet and make changes in it
About the code you asked, <?php if(date("d")==1){ //send email mail( "", "subject", "this is email message", "From: noreply@your_domain.com" ); }else{ exit(); } ?> Second, you'd need to automate it somehow, like suggested above, use cron In cron, if you set the script to run only on 1st of each month then you do not need condition check. Only your email script. <?php mail( "", "subject", "this is email message", "From: noreply@your_domain.com" ); ?>
The answer is use a cronjob. The next thing for you to do is research cronjob to find out how to use it in your web hosting environment. It's silly to keep asking step by step questions. You're just killing time for yourself and taking up others...