0
我正在Rails中構建一個聯繫表單。我正在使用gmail發送消息。它在開發中完美運作,但不在生產中。 Heroku給了我這個錯誤:本地工作但不在生產的軌道中的smtp設置
2017-02-03T21:47:02.629544+00:00 app[web.1]: I, [2017-02-03T21:47:02.629450 #4] INFO -- : [082aab82-7b98-45b4-97da-b92470134ef8] Completed 500 Internal Server Error in 731ms (ActiveRecord: 0.0ms)
2017-02-03T21:47:02.630122+00:00 app[web.1]: F, [2017-02-03T21:47:02.630063 #4] FATAL -- : [082aab82-7b98-45b4-97da-b92470134ef8]
2017-02-03T21:47:02.630180+00:00 app[web.1]: F, [2017-02-03T21:47:02.630122 #4] FATAL -- : [082aab82-7b98-45b4-97da-b92470134ef8] Net::SMTPAuthenticationError (534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbsT
這似乎表明它有麻煩,我的smtp設置。這裏是我的生產環境中的設置。誰能幫忙?
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => "587",
:domain => "gmail.com",
:user_name => "[email protected]",
:password => "mypassword",
:authentication => "plain",
:enable_starttls_auto => true
}
可能的複製登臺環境)](http://stackoverflow.com/questions/18124878/netsmtpauthenticationerror-when-sending-email-from-rails-app-on-staging-envir) –