7

I downloaded a project from github that has a mailer when deployed to production, but on my own local copy the mailer doesn't work. How do I setup mail locally for development so that I can test it?

Stewbob
  • 16,759
  • 9
  • 63
  • 107
GiH
  • 14,006
  • 13
  • 43
  • 56
  • 2
    Possible duplicate of http://stackoverflow.com/questions/5286009/actionmailer-and-development-mode-can-it-write-to-a-file-or-something. – Brian Donovan Nov 20 '11 at 20:17

4 Answers4

9

You can use letter_opener gem by Ryan Bates

Andrey Kryachkov
  • 891
  • 4
  • 14
  • thanks, i liked this one the most from the answers provided. I personally ended up using the answer in the duplicate question here http://stackoverflow.com/questions/5286009/actionmailer-and-development-mode-can-it-write-to-a-file-or-something as it didn't need me to install anything, but this would be my second option. – GiH Dec 07 '11 at 06:11
6

You can try the MailCatcher gem https://github.com/sj26/mailcatcher

Pragnesh Vaghela
  • 1,327
  • 12
  • 16
4

You don't need a gem.

In:

config/environments/development.rb

Set

Rails.application.configure do
  config.action_mailer.delivery_method = :file
end

Then look for the mails in

PROJECT_ROOT/tmp/mails/email@example.com
FreePender
  • 4,770
  • 2
  • 18
  • 15
1

I use this when testing email during local development. Hope this helps

http://papercut.codeplex.com/

Darren
  • 329
  • 1
  • 6