2014-06-20 34 views
0

在生产中,我的Rails应用程序不会发送电子邮件。我正在使用Heroku。我看过similar post,但答案并没有帮助我。电子邮件不会从使用Mandrill的Rails应用程序发送

它适用于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'] 
} 

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

回答

1

我已经使用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' 
} 
相关问题