How to use MailCatcher in Rails

Tomoharu Tsutsumi
1 min readNov 3, 2019

--

I have had an opportunity to use MailCatcher. So, I summarize it in order not to forget it. MailCatcher enables you to set up a local SMTP server. If you want to try out mailer functions in your application, I recommend this. It is so easy and effective.

  1. Install gem
gem 'mailcatcher'$ bundle

2. Write port number, address and domain

config.action_mailer.raise_delivery_errors = false
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { address: '127.0.0.1', port: 1025, domain: '127.0.0.1' }

3. Start mailcatcher

$ mailcatcher

4. go to mailcatcher

'http://127.0.0.1:1080/'

If you think this article good, please follow me!

I update articles once a week!

https://twitter.com/tomoharutsutsum

--

--

Tomoharu Tsutsumi

Senior Software Engineer at two industry-leading startups ( Go | Ruby | TypeScript | JavaScript | Gin | Echo | Rails | React | Redux | Next)