Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A web interface for browsing Ruby on Rails sent emails
Ruby JavaScript


Build Status Gem Version Code Climate Gittip Gitter chat

Gives letter_opener an interface for browsing sent emails.

Check out to see it in action.


First add the gem to your development environment and run the bundle command to install it.

gem 'letter_opener_web', '~> 1.2.0', :group => :development


Add to your routes.rb:

Your::Application.routes.draw do
  if Rails.env.development?
    mount LetterOpenerWeb::Engine, at: "/letter_opener"

And make sure you have :letter_opener delivery method configured for your app. Then visit http://localhost:3000/letter_opener after sending an email and have fun.

If you are running the app from a Vagrant machine, you might want to skip letter_opener's launchy calls and avoid messages like these:

12:33:42 web.1  | Failure in opening /vagrant/tmp/letter_opener/1358825621_ba83a22/rich.html
with options {}: Unable to find a browser command. If this is unexpected, Please rerun with
environment variable LAUNCHY_DEBUG=true or the '-d' commandline option and file a bug at

In that case (or if you just want to browse mails using the web interface), you can set :letter_opener_web as your delivery method on your config/environments/development.rb:

config.action_mailer.delivery_method = :letter_opener_web

# If not everyone on the team is using vagrant
config.action_mailer.delivery_method = ENV['USER'] == 'vagrant' ? :letter_opener_web : :letter_opener

Usage on Heroku

Some people use this gem on staging environments on Heroku and to set that up is just a matter of moving the gem out of the development group and enabling the route for all environments on your routes.rb.

In order words, your Gemfile will have:

gem 'letter_opener_web', '~> 1.2.0'

And your routes.rb:

Your::Application.routes.draw do
  mount LetterOpenerWeb::Engine, at: "/letter_opener"

You might also want to have a look at the sources for the demo available at

NOTICE: Using this gem on Heroku will only work if your app has just one Dyno and does not send emails from background jobs. For updates on this matter please subscribe to GH-35


Special thanks to @alexrothenberg for some ideas on this pull request.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.