我正在使用带有动作邮件程序的 mandril。在我的 mandril 配置上
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
在 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
关于开发.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
我正在运行邮件捕手并访问http://localhost:1080/但它不起作用,我需要添加更多配置吗?