Manage cookies that are used for advertising, such as ad personalization, remarketing, and ad effectiveness analysis.
2.12.1.2. Reports do not reach recipient
If messages with reports are sent in the usual way, but do not reach the recipient, try organizing your own sending of reports via SMTP or using sendmail, as described below.
Important points:
- Only the output of the executed command will be sent to the mail.
- For the
wgetandcurlutilities, do not use the-qkey, which suppresses output.
SMTP
- Create a file named
report.phpin the root directory of your hosting account and place the script from instruction in it, specifying your details. - In the script, additionally replace the line:
$text = "Hello, checking the SMTP connection."; // contents of the message being sentWith the line:
$text = shell_exec(addslashes($argv[1]) . " 2>&1"); - Add a cron task and specify the following command as the task:
/usr/local/bin/php -f /home/example/report.php "command"- Instead of
example, specify the name of the hosting account. - Instead of
command, specify the command for which you want to receive reports.
- Run a test launch of the task to make sure everything works as intended.
sendmail
When using sendmail, you can avoid creating additional files.
- Add a cron task and specify the following command as the task:
OUTPUT=$(command);echo -e "Subject:cron report\n${OUTPUT}" | sendmail -f "sender@example.com" -t "receiver@example.com"- Instead of
command, specify the command for which you want to receive reports. - The text
cron scriptis the subject of the message (you can replace it with your own). - Instead of
sender@example.com, specify any mailbox that is serviced on our hosting. - Instead of
receiver@example.com, specify the email of the report recipient.