NTS Forums

Please login or register.

Login with username, password and session length
 

News:

Welcome to the Newtek Technology Services Forum!


Author Topic: FYI - Cron job must generate screen output in order to send confirmation email  (Read 407 times)

Offline mhurwicz

  • Hosting Newbie
  • *
  • Posts: 21
  • Karma: +0/-0
Step 3 of the knowledgebase article below should be updated to note that the cron daemon  only sends the notification email if there is screen output from the cron command.

https://help.webcontrolcenter.com/kb/a1813/creating-cron-jobs-cpanel.aspx

For instance, if I have the confirmation email set to myconfirm@myemail.com and I execute a php file from a cron job that looks like this, no confirmation email is sent:

<?php mail('me@myemail.com','Cron Job Ran',phpversion()); ?>

The php generated email (to me@myemail.com) is sent, but nothing is sent to myconfirm@myemail.com.

On the other hand, if the php file looks like this, both emails (the php generated email and the confirmation email) are sent, because the echo command generates screen output, causing the cron daemon to send the confirmation email:

<?php echo "completed", mail('me@myemail.com','Cron Job Ran',phpversion()); ?>

http://www.top3s.com
The Top 3 of Everything