Sending HTML mail via sendmail cli

Here’s how to do it

# ( cat <<HEADERS; cat /root/file.html) | sendmail -oi -t
From: sender@domain.tld
To: recipients@domain.tld
Subject: we send HTML instead of plain text
Mime-Version: 1.0
Content-type: text/html
Content-transfer-encoding: 8bit

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.