View HTML emails in mutt
Mutt is a console based mail client which can connect to IMAP, or POP3 mail servers. It can also read and write to local mailboxes. For a console client it’s very sophisticated, allowing you to customize your setup enormously. One thing that it lacks by default is the ability to read HTML emails though.
If you wish to view HTML mails inside the mutt user interface you’ll need to make two changes.
First of all you setup a mailcap file which will automatically dump the HTML text to a readable text-only display, via lynx, elinks, or w3m. Then you need to tell Mutt that it should do this automatically for all HTML files.
Save the following in a file called “.mailcap” in your home directory. If you already have such a file just add it to the end:
text/html; elinks %s; nametemplate=%s.html text/html; elinks -dump %s; nametemplate=%s.html; copiousoutput
If you prefer a different program to render your HTML you can change the links command to that instead – for example links, w3m, or lynx.
Now we tell mutt that it should automatcally view the text/html parts of message by adding the following to the .muttrc file in our home directory:
auto_view text/html
These two changes should be enough to make sure that Mutt will dispaly HTML mails for us, and allow us to reply to them properly.
Many more things in mutt can be customized, and if you’re using it for any length of time you’re definately encouraged to read the mutt manual available on the Mutt homepage.







