How can I send an HTML email using a shell script?
Mime header and from, to address also can be included in the html file it self.
Command
cat cpu_alert.html | /usr/lib/sendmail -t
cpu_alert.html file sample.
From: donotreply@example.com
To: admin@example.com
Subject: CPU utilization heigh
Mime-Version: 1.0
Content-Type: text/html
Mail body will be here
The mail body should start after one blank line from the header.
Sample code available here: http://sugunan.net/git/slides/shell/cpu.php