2015-11-19 49 views
0

不接受我有我的電子郵件中發展設置和它完美的作品:電子郵件生產

# Don't care if the mailer can't send. 
    config.action_mailer.raise_delivery_errors = false 
    config.action_mailer.delivery_method = :smtp 
    config.action_mailer.perform_deliveries = true 
    config.action_mailer.smtp_settings = { 
    :authentication => :plain, 
    :address => "smtp.mailgun.org", 
    :port => 587, 
    :domain => "somedomain.co", 
    :user_name => "[email protected]", 
    :password => "password" 
    } 
    config.action_mailer.default_url_options = { :host => 'localhost:3000' } 

並在生產中:

config.action_mailer.delivery_method = :smtp 
    config.action_mailer.perform_deliveries = true 
    config.action_mailer.raise_delivery_errors = false 
    config.action_mailer.smtp_settings = { 
    :authentication => :plain, 
    :address => "smtp.mailgun.org", 
    :port => 587, 
    :domain => "somedomain.co", 
    :user_name => "[email protected]", 
    :password => "password" 
    } 
    config.action_mailer.default_url_options = { protocol: 'https', host: 'nestie.co' } 

但在生產中我沒有收到任何電子郵件。

對你來說,看起來有點不對勁嗎? 我不知道怎麼回事......

+0

你有沒有在你的開發和生產日誌尋找線索? –

+0

我也很喜歡,但我不知道我該如何做到這一點。我通常使用Heroku,並且可以使用'heroku logs'來檢查日誌,但是這個應用程序正在使用另一個服務,可能是AWS – Cyzanfar

+0

我指的是./log/develop.log'和'./log/product.log'裏面你的項目。我還會設置'config.action_mailer.raise_delivery_errors = true'並查看彈出的內容。附:什麼版本的Rails/AM? –

回答