我们使用 ExceptionNotifier Gem 的 Rails 应用程序
并更改配置文件
异常邮件运行良好
但是发件人邮件不是 Noreply < noreply@our_domain.com >
始终发件人是我的电子邮件地址
我的 production.rb 文件是
config.log_formatter = ::Logger::Formatter.new
config.middleware.use ExceptionNotification::Rack,
:email => {
:email_prefix => "[Exception ",
:sender_address => %{"Noreply" <noreply@our_domain.com>},
:exception_recipients => %w{my_email@gmail.com}
}
setup_mailer.rb 文件是
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "our_domain.com",
:user_name => "my_eamail@our_domain.com",
:password => "PASSWORD",
:authentication => "login",
:enable_starttls_auto => true
}
为什么发件人地址不变???