I hope somebody will be able to help me.
I am running a Cron job which mails the content of a log report every day. The problem is that the contents are sent as an attachment instead of as the body of the email. The strange thing is that if I run the instructions from the command line everything works fine, but if I do so from the Cron job the log report is attached instead of being sent inline.
The instruction I use is:
mail -s "logfile for cron" firstname.lastname@example.org </var/log/cron-log
Following some advice I read on a blog I also tried this instruction in my Cron file, but the result is the same: it works fine from the command line, but attaches the report when run from Cron:
echo "Content-Type: text/plain;" | mail -s "logfile for cron" email@example.com </var/log/cron-log
Does anybody know how to ensure the content of the log file is inline?