Read more

Mailcatcher: An alternative to inaction_mailer

Thomas Eisenbarth
October 13, 2011Software engineer at makandra GmbH

Looks simpler than inaction_mailer Show archive.org snapshot :

gem install mailcatcher
mailcatcher
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

Setup Rails to send mails to 127.0.0.1:1025. Usually you want the following config in config/environments/development.rb and maybe in test.rb or cucumber.rb.

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  :address => 'localhost',
  :port => 1025
}

Now you can see sent mails in your browser when opening http://127.0.0.1:1080 Show archive.org snapshot

Note: In order to see the emails in the MailCatcher interface and keep your cucumber features running, copy the attached initializer to your config/initializers directory.
After that you have to change the delivery_method in your environment config from :smtp to :mailcatcher.
Now the mails will be send to MailCatcher via SMTP and stored in the ActionMailer::Base.deliveries array, too.

Posted by Thomas Eisenbarth to makandra dev (2011-10-13 20:49)