Sending HTML mail via sendmail cli
Here’s how to do it
1 | # ( cat <<HEADERS; cat /root/file.html) | sendmail -oi -t |
2 | From: sender@domain.tld |
3 | To: recipients@domain.tld |
4 | Subject: we send HTML instead of plain text |
5 | Mime-Version: 1.0 |
6 | Content- type : text/html |
7 | Content-transfer-encoding: 8bit |
8 |
9 | HEADERS <- type CTRL+D then press ENTER |
We should set Mime-Version , Content-Transfer-Encoding and Content-Type headers properly. The issue of correct MIME transfer encoding is one of the many possible complexities which is simply ignored here.