/mail_opener

Intercept outgoing mail from Rails and open in Mac OS X Mail app

Primary LanguageRubyMIT LicenseMIT

Mail Opener opens your mail

Mail Opener is similar to many other gems designed to allow you to view mail sent from your web app in development mode without using a real mail server or accidentally test messages to real people.

Mail Opener is dirt simple: it writes each email to a file and then opens that file in the Mac OS X Mail application. This is nice because you can preview the email directly in an email reader, instead of a web browser.

There are some shortcomings:

  1. If you send a thousand messages, a thousand message windows will open. You might not want that.
  2. If you don't have a Mac, this gem will probably not work. If you know how to make it useful on another platform, pull requests are welcome.

Rails Setup

Add the gem to your Gemfile

group :development do
  ...
  gem 'mail_opener'
  ...
end

and then set the delivery method in config/environments/development.rb

config.action_mailer.delivery_method = :mail_opener

and you're good to go.