Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send Html page As Email using "mutt"

Tags:

bash

mutt

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???

like image 913
eldorado0o Avatar asked Jul 24 '11 08:07

eldorado0o


2 Answers

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.

like image 142
vstm Avatar answered Sep 20 '22 04:09

vstm


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:

mutt -e "my_hdr Content-Type: text/html" [email protected]  -s "subject" < mytest.html 

Reference here

LinuxQuestions

like image 22
Kevin Zhu Avatar answered Sep 19 '22 04:09

Kevin Zhu