2015-06-08 25 views
0

Actionmailer似乎無法發送我的電子郵件,我的應用程序在生產環境中。我有下面的一組在我的配置/環境/ production.rbRails 4.2.1操作郵件程序未提供郵件

config.action_mailer.delivery_method = :sendmail 
    config.action_mailer.perform_deliveries = true 
    config.action_mailer.raise_delivery_errors = true 
    config.action_mailer.default_options = {from: '[email protected]'} 
    config.action_mailer.default_url_options = { host: 'http://domain.com' } 

發送郵件

UserMailer.welcome(self).deliver_now 

Rails的版本:4.2.1

在我production.log顯示沒有錯誤,所有任務都已完成,並在日誌中顯示實際的郵件輸出。

Thanx!

回答

1

試試這個

config.action_mailer.delivery_method = :smtp 

config.action_mailer.smtp_settings = { 
    :address => "smtp.gmail.com", 
    :port => 587, 
    :user_name => "your mail", 
    :password => "your password", 
    :authentication => :plain, 
    :enable_starttls_auto => true 
} 
+0

這並不工作,在技術上不是我想要的,因爲我要使用sendmail而不是SMTP,但是這仍然是正確的,使我藏漢解決我自己的問題,所以感謝名單的解決方案! :) – user1648746

相關問題