Rails ActionMailer 在 production 环境下发送邮件 500,求破

zhbinx · September 16, 2013 · Last by song940 replied at September 16, 2013 · 2705 hits
config.action_mailer.smtp_settings = {
    :address => "smtp.xxx.com",
    :port => 25,
    :domain => "xxx.com",
    :authentication => :login,
    :user_name => "[email protected]",
    :password => "154#AbitU@s",
    :enable_starttls_auto => true
}

相同的代码、机器把环境切换到 production,发邮件就会出报错

Sent mail to [email protected] (1156ms)
Completed 500 Internal Server Error in 1688ms

Errno::ECONNREFUSED (No connection could be made because the target machine actively refused it. - connect(2)):

windows\linux 都错 求指导,谢谢!

买个发邮件的服务不就搞定了。

#1 楼 @xds2000 嗯?我用的公司的 smtp 服务器呀,这个是个内网的小东西

咦好像把config.action_mailer.smtp_settingsproduction.rb里复制一下就好了。。 不是说 development.rb 里的配置也会在production.rb里生效的么?

直接放在 environment.rb 里啊,开发,测试,线上都会使用这一个配置,你那样做还要拷来拷去的

You need to Sign in before reply, if you don't have an account, please Sign up first.