LoginSignup
12
10

More than 5 years have passed since last update.

Vagrant+Railsでmailcatcherを使う

Last updated at Posted at 2015-07-27

MailCatcher

MailCatcher runs a super simple SMTP server which catches any message sent to it to display in a web interface.

mailcatcherインストール

Gemfile

# Gemfile: 

group :development, :test do
  gem 'mailcatcher'
end

config/environments/development.rb:

# config/environments/development.rb:

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

インストール

$ vagrant ssh
$ cd /your/project
$ bundle install

mailcatcher起動

$ vagrant ssh
$ cd /your/project
$ bundle exec mailcatcher --http-ip 192.168.33.10

ブラウザでhttp://192.168.33.10:1080にアクセスします
(iptablesなどで1080番を閉じている場合は、解放してください)

参考

12
10
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
10