I have a stats program which runs on log files via cron. The stats program can output HTML.
Right now I rely on the MAIL_TO mechanism in the crontab.
[email protected]
55 23 * * * /usr/bin/htmlstats
The problem is that I want the email sent to display as HTML and not as plain text.
Cron places the following header in the email:
Content-Type: text/plain; charset="UTF-8"
Any idea how I would change this to:
Content-Type: text/html; charset="UTF-8"
I put the
CONTENT_TYPE="text/plain; charset=utf-8"
in/etc/crontab
to have my mail in UTF-8.Put
CONTENT_TYPE="text/html; charset=utf-8"
in/etc/crontab
to send the mail in HTML.You may add it in specific file if the directory
/etc/cron.d/
exists. In this case, the specification is defined only for the requested tasks.I don't think you can. A solution could be to pipe the output to sendmail or mail, which gives you more control over content type and other headers.
YES, you can.