Send Html page As Email using "mutt"

eldorado0o picture eldorado0o · Jul 24, 2011 · Viewed 51k times · Source

I have been using mutt to send emails from inside another application & it works fine. I have to send html files and currently I have to send them as attachments. So I use

mutt -s "hi" -a attach.html [email protected] < /dev/null

But if I try to send the html file as the body as follows

mutt -e content_type=text/html Email address -s "subject" < test.html

then instead of the html file i get the source text of the html file.

Is there any way that I can make the body of the message as html instead of plain text???

Answer

vstm picture vstm · Jul 24, 2011

When I try your command, mutt is telling me that content_type=text/html is an unknown command. So you have to use the "set" command to make this work:

mutt -e "set content_type=text/html" Email address -s "subject" < test.html

That worked in my tests.