0

I am using mandril with action mailer. On my mandril config

ActionMailer::Base.smtp_settings = {
:port =>           '587',
:address =>        'smtp.mandrillapp.com',
:user_name =>      ENV['MANDRILL_USERNAME'],
:password =>       ENV['MANDRILL_APIKEY'],
:domain =>         ENV['MANDRILL_DOMAIN'],
:authentication => :plain
}
ActionMailer::Base.delivery_method = :smtp

MandrillMailer.configure do |config|
  config.api_key = ENV['MANDRILL_API_KEY']
end

Rails.application.config do |config|
   config.mandrill_mailer.default_url_options = { host: ENV['DEFAULT_URL_HOST'] }
config.mandrill_mailer.default_url_options['protocol'] = ENV['DEFAULT_URL_PROTOCOL'] unless ENV['DEFAULT_URL_PROTOCOL'].blank?
end

On the action_mailer.rb

Rails.application.configure do
config.action_mailer.default_url_options = { host: ENV['DEFAULT_URL_HOST'] }
config.action_mailer.default_url_options['protocol'] = ENV['DEFAULT_URL_PROTOCOL'] unless ENV['DEFAULT_URL_PROTOCOL'].blank?
end

On the development.rb

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

I am running mail catcher and visiting http://localhost:1080/ but it doesn't work, do I need to add more configurations ?

user3814030
  • 1,263
  • 3
  • 20
  • 37

1 Answers1

0

I'm using the default smpt_settings with mailcatcher in dev mode. so I didnt specify the

 config.action_mailer.smtp_settings = ..

at all.

But I have to launch mailcatcher in the foreground with

mailcatcher -f

for it to work (it's somehow buggy as deamon). This has the advantage, that you can see if it receives the mail requests.

Axel Tetzlaff
  • 1,355
  • 8
  • 11