8
我想通过PRODUCTION中的我的Gmail帐户发送电子邮件。它在当地主机很好用。Rails:在生产中通过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 => "[email protected]",
: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
我必须放什么?
谢谢!
如果你有这个答案,我真的很想知道。 – 2013-03-11 18:03:06