繁体   English   中英

电子邮件未使用Mandrill从Rails应用发送

[英]Email doesn't send from Rails app using Mandrill

在生产中,我的Rails应用程序不发送电子邮件。 我正在使用Heroku。

我看过类似的帖子 ,但是答案并没有帮助我。

它适用于Gmail,但不适用于Mandrill。

Gmail的:

config.action_mailer.default_url_options = { host: 'app.herokuapp.com', :protocol => 'http' }
config.action_mailer.smtp_settings = {
  address: "smtp.gmail.com",
  port: 587,
  user_name: ENV['USERNAME'],
  password: ENV['PASSWORD']
}

山魈:

config.action_mailer.default_url_options = { host: 'app.herokuapp.com', :protocol => 'http' }
config.action_mailer.smtp_settings = {
  address: "smtp.mandrillapp.com",
  port: 25,
  user_name: ENV['USERNAME'],
  password: ENV['API_KEY']
}

另请注意,我已经尝试切换端口号!

我在其中一个应用程序中使用了mandrill,但没有任何复杂性。 请尝试使用这些配置集,如果它们对您不起作用,请通知我

config.action_mailer.default_url_options = { host: 'app.herokuapp.com' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  :address => "smtp.mandrillapp.com",
  :port => 587,
  :user_name => ENV['USERNAME'],
  :password => ENV['API_KEY'],
  :authentication => 'login',
  :enable_starttls_auto => true,
  :openssl_verify_mode  => 'none'
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM