2.11.1.2. The reports do not reach the recipient

If emails with reports sent in the usual waydo not reach the recipient, try organizing your own sending of reports using one of the methods described below.

Important points:

  • Only what the command being executed will be sent to the mail.
  • When using utilities wget and curl do not use the key -qwhich suppresses the output.
  1. Create a file named report.php in the root of the hosting account and place the script from instructionby specifying your data in it.
  2. In the script, additionally replace the line:
    $text = "Hi, checking the SMTP connection."; // содержимое отправляемого письма

    Per line:

    $text = shell_exec(addslashes($argv[1]) . " 2>&1");
  3. Add a cron task and specify the following command as a task:
    /usr/local/bin/php -f /home/example/report.php "command"
    • Instead example indicate title hostingaccount.
    • Instead command specify the command for which you want to receive reports.
  4. It is recommended to first run the command manually, connecting over SSH to make sure it works as intended.
The method allows you to do without creating additional files.
  1. Add cron task, 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 command specify the command for which you want to receive reports.
    • Message cron script this is the subject line of the email, you can replace it with your own.
    • Instead sender@example.com specify any domain mailbox directed to our hosting.
    • Instead receiver@example.com specify the mailbox of the recipient of the report.
  2. It is highly recommended to configure SPF and DMARC policies for the domain whose mailbox was specified in the command as the sender.
Content