PRODUCTION の gmail アカウントからメールを送信したいと考えています。ローカルホストでうまく機能します。
私のenvironment.rbには次のものがあります:
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "myhost.com",
:authentication => "plain",
:user_name => "name@myhost.com",
:password => "mypassword",
:enable_starttls_auto => true
}
そして私の production.rb ファイルで:
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => 'gmail.com' }
しかし、それは機能せず、そのエラーがあります:
Errno::ECONNREFUSED (Connection refused - connect(2)):
何か案は ?私のアプリは Heroku にデプロイされています。何host
を入れなければなりませんか?
ありがとう !