2013-10-12 153 views
0

我正在使用delayed_job_active_record将长时间运行的进程推送到后台。除了电子邮件发送以外,它非常有效它处理工作并完成它,但电子邮件永远不会来到这里。这个问题只是在生产中。所以,我试着来回切换邮件设置,结果是,如果我使用开发设置它将工作得很好,但如果我使用生产设置它不。延迟作业未发送特定电子邮件设置的电子邮件

我测试了没有delayed_job的邮件设置,它在两种环境中都能很好地工作,所以我确信问题不在于电子邮件设置。

在生产环境中

config.action_mailer.default_url_options = { :host => 'www.xyz.com' } 
config.action_mailer.delivery_method = :smtp 
config.action_mailer.smtp_settings = { 
    :address  => 'smtp.sendgrid.net', 
    :port   => '587', 
    :authentication => :plain, 
    :user_name  => 'xyz', 
    :password  => 'password123', 
    :domain   => 'heroku.com' 
} 

在发展enviornment

config.action_mailer.default_url_options = { :host => 'localhost:3000' } 
config.action_mailer.delivery_method = :smtp 
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 } 

任何想法?

回答