I need to send email with html format. I have only linux command line and command \"mail\".
Currently have used:
echo \"To: address@example.com\" >
With heirloom-mailx you can change sendmail program to your hook script, replace headers there and then use sendmail.
The script I use (~/bin/sendmail-hook):
#!/bin/bash
sed '1,/^$/{
s,^\(Content-Type: \).*$,\1text/html; charset=utf-8,g
s,^\(Content-Transfer-Encoding: \).*$,\18bit,g
}' | sendmail $@
This script changes the values in the mail header as follows:
Content-Type: to text/html; charset=utf-8Content-Transfer-Encoding: to 8bit (not sure if this is really needed).To send HTML email:
mail -Ssendmail='~/bin/sendmail-hook' \
-s "Built notification" address@example.com < /var/www/report.csv