Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (23 sloc) 1.13 KB

Mail Magnet

Mail Magnet allows you to override e-mail recipients in ActionMailer so all mails go to a given address. This is useful for staging environments where you want to test production-like mail delivery without sending e-mails to real users.


Install the gem with

sudo gem install mail_magnet

In the environment for which you'd like to override mail recipients:

config.gem 'mail_magnet'
config.after_initialize { ActionMailer::Base.override_recipients = '' }

Now all e-mail sent by your ActionMailers goes to '' (including CC and BCC recipients). The original recipients will be quoted inside the mail body, like this:

- - - Original recipients - - -
- - - - - - - - - - - - - - - -

Original e-mail body goes here.

Rails 3 compatibility

We cannot guarantee Rails 3 compatibility at this point, but we will upgrade the gem when Rails 3 is released.


Arne Hartherz