Pages

Monday, November 26, 2018

Send HTML email in Llnux



A lot of Q&A out on the web, the best one I can find.

On my system , 2 successful implementations:

1. sendmail
(echo "From: sender@aaa.com}";
echo "To: receiver@bbb.com";
echo "Reply-To: all@ccc.com";
echo "Subject: HTML test";
echo "Content-Type: text/html";
echo "MIME-Version: 1.0";
echo "";
echo "<b>line1</b>";
echo "line2";
echo "<b>line3</b>";
) | sendmail -t


2. mutt  man
export REPLYTO="replyTo"

mutt -e 'set content_type="text/html"' -s "test"  xxx@yyy.com <$FILE


* cannot get mailx to include mail header info
REPLYTO can store very long text, but mutt only takes around 225 chars, so if the reply list long switch to sendmail.