不發送到config /環境/ production.rb下面電子郵件生產
BASE_URL = "http://proproots.herokuapp.com/"
STATIC_WEBSITE = "http://proproots.herokuapp.com/"
REDIRECTING_URL = "http://proproots.herokuapp.com/"
config.action_mailer.default_url_options = { :host => 'proproots.herokuapp.com' }
config.action_mailer.raise_delivery_errors = true
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => "587",
:domain => "www.gmail.com",
:user_name => "[email protected]",
:password => "password",
:authentication => "login",
:enable_starttls_auto => true,
:openssl_verify_mode => 'none'
}
服務器日誌中給出
2013-12-13T17:33:49.134524+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=proproots.herokuapp.com fwd="122.164.115.170" dyno=web.1 connect=6ms service=5ms status=304 bytes=0
它是工作在開發環境很好,但在生產不能正常工作,請嘗試的人解決此問題
這是不正確的。您不需要附加軟件來發送電子郵件。請參閱:http://www.azgaard.com/2012/06/05/sending-email-from-rails-using-smtp-on-heroku/ – CDub