Besides mails_viewer, there are several more choices such as mail_view, letter_opener, mailcatcher and mailsafe. Checkout our blog http://blog.pragmatic.ly/announcing-mailsviewer-a-rails-engi... for more info. There is a link in the github page but I think it's not clear, :)
Thanks for the list. I searched for these months ago and couldn't find much. I ended up using https://github.com/wireframe/email_preview, but some of these look pretty nice.
I usually do this with a dummy controller rigged up to show them in the browser and fire them at whitelisted test inboxes, but always nice to see more ways people handle these challenges.
We've been using letter_opener (https://github.com/ryanb/letter_opener), which handles the "preview" case very well (opens the rich text and plain emails in separate browser tabs on send). Doesn't do the other stuff that mails_viewer does, but a good lightweight alternative.
There seem to be a few different problems being solved by the suggestions in the comments:
1. I don't want to send out emails in dev mode. At all. (mailsafe)
2. I want an easier way of looking at the emails my server does send out (letter_opener, mailcatcher, mails_viewer)
3. I want to be able to preview an email without having to do the action that triggers it (mail_view)
mails_viewer can do 1 and 2. The default usage will not send out emails at all. But if you want, you can. So it's preview and conditional send.
mail_view requires you to write additional code. The pro is that you can preview it lively without doing the action again. The con is that you have to write the scenario for preview.
Cool, :) So you start a smtpd to catch your mails and do the test. That's also how MailCatcher(http://mailcatcher.me) works. If it's fine to start a smtpd, it's a good choice too!
There's also Mailtrap http://mailtrap.io/ that prevents test emails from getting to real addresses, and collects them on a server where they could be viewed by every member of the team.
Good to see it got a maintainer. We use this gem together with postfix, all mails goes to postfix will be redirected to the gem. Then we use this postfix server for all our apps on staging, works pretty well.
@mr_november Thanks for read. You can directly get the codes at the github. Tomlion is my former colleague and I worked with him on this project at the beginning. And now I'm the only maintainer and you can see the changes via the commits. But true it's better to write the changes in the README. Thanks.