How to Enable Weekly / Monthly or Daily Email Reports and Alerts
1. Configure Email Settings
There are three things you should do to enable email alerts / reports in Watch My Domains Server Edition. The first step is specifying your email settings like "From Address", "From Name", etc.
Go to the "Basic App setup" and select the "Email Options" tab. Enter the various email settings like
Email Method etc. In most cases you can leave the "Send Method"
at "default". For the default method you don't have to provide a smtp password or login name.
2. Select a suitable Script from the Samples
lib/php/custom folder has a number of sample scripts. Choose one of them, for example,
expiry-report-sample.php, copy it to
expiry-report.php and open it in a text editor.
Make changes to include your "to" email address. If you want, you can also change the number of
days to monitor for expiry dates, the columns to include in email and so on. Also set the "$sendemail" to true.
3. Test the Email Script and Add it as a Cron Job
lib/php/expiry-report.php in a browser. This should show you an HTML report. If you have set
the "$sendemail" to true, an email also should come to the specified address.
Add the script to cron table if every thing is working fine. The following entry will send emails every week.
0 0 * * 0 php /home/softnik/wmdsed24/lib/php/custom/expiry-report.php key=xxx >/dev/null 2>&1
Please remember to edit the path to the script as required. Replace
xxx with your CLI authorization key.
This key is available in the "Authentication" of "Basic App Setup" screen.
CLI Authorization Key
The CLI Authorization Key is used to run various reports and other scripts as a cron job. The report generation scripts will run only if you are logged in (assuming you have enabled the built-in password protection). This will be a problem when you try to run scripts as a cron job. The CLI authorization key allows you to specify key=xxx as a command-line parameter (when running the script as PHP CLI) or as a GET variable (when running as a web script) so that the script will execute without logging in.