我想在本地(開發)測試異常通知程序。這裏是我的當前設置:Rails 4 +異常通知程序不會以開發模式發送電子郵件
development.rb
Myapp::Application.configure do
# Set Mailer default url
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => '0.0.0.0:3000' }
#config.action_mailer.delivery_method = :file
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'smtp.gmail.com',
:port => 587,
:domain => 'gmail.com',
:user_name => '[email protected]',
:password => 'password',
:authentication => 'plain',
:enable_starttls_auto => true
}
config.middleware.use ExceptionNotification::Rack,
:email => {
:email_prefix => "[Myapp Error] ",
:sender_address => %{"notifier" <[email protected]>},
:exception_recipients => %w{[email protected]}
}
end
但在應用時,我「創造」的錯誤 - 例如,如果我設置了不存在的ID,如
http://localhost:3000/users/12270/edit
我只能在瀏覽器中看到錯誤,但不發送電子郵件(電子郵件憑據是正確的)。
我錯過了什麼?
比你