Cron – Send HTML-Formatted Emails

cronemail

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.

MAILTO=my@email.addr
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"

Best Answer

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.