I have a cron command that runs a file and I'm trying to setup the output so it emails to me. I use this with 3rd party scripts that I don't want to modify the direct files, so I need to pipe the output instead of modifying the PHP.
I'm migrating from a server that uses
sendmail. I'm struggling to find out how to properly send a subject to sendmail via a command line.
/usr/local/bin/php -f /path/to/file.php 2>&1 | /usr/sbin/sendmail -s "My Test Email Subject" firstname.lastname@example.org