Reading HTML Email with Mutt

Last updated: Aug 4, 2008

Mutt is my new favorite productivity tool. I have been blazing through my emails and setting up custom macros and commands like crazy. I have have found myself optimizing mutt more than actual reading email since it makes checking email go by so fast. Like Vim I would say mutt has dramatically changed the way I do things.

One of the things I get a little annoyed by is emails written in HTML. I have no need for images and other garbage filled emails. I would say 90% of the emails that contain HTML are spam; however, I occasionally I needed to read those HTML emails.

The only thing you have to do for Mutt to read HTML is tell it which browser you want to open.

Setting it all up

First install Links2 with your distro’s package manager.

apt-get install links2

Then create a file called, .mailcap in your home directory with the following lines:

text/html; links2 %s; nametemplate=%s.html text/html; links2 -dump %s; nametemplate=%s.html; copiousoutput

This will tell mutt to open the html files with links2 and then dump them back to the screen. This is handy so you don’t have to open the full links2 browser.

Then add this to your .muttrc:

auto_view text/html

Now when you go to read an email with HTML you should be able to see it without all the markup.

Need to print shipping labels on your site?

Checkout my product RocketShipIt for simple easy-to-use developer tools for UPS™ FedEx™ USPS™ and more.

Get notified on new posts or other things I'm working on

Share: