2014-06-20 36 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' 
} 
相關問題