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 user@domain.com < /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???
I use Mutt 1.5.23 to send an html email with embedded image, and this works for me.
mutt -e "set content_type=text/html" Email -s "subject" -a pic.png < test.html
file test.html:
my mutt version is 1.4.x, and I also cannot set content_type=text/html, it is reported as unknown variable.
and I checked the mutt doc, the content_type is only supported by version 1.5.x, such as the latest version 1.5.21.
obviously, html mail was not supported by version 1.4.x.
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:That worked in my tests.
I tried with mutt 1.6d and that option -e "set content_type=text/html" doesn't work for me. After search around i found below command line works for me:
Reference here
LinuxQuestions
If you look at the source of an HTML email, you'll see at minimum something like:
So, you have to create a "Content-Type:" header, and add the boundaries above the text-only version, and above and below the HTML version.
Given the amount of hand-crafting required, you might as well hand the message over to sendmail instead of mutt.