Redmine 中的电子邮件配置 - 未定义的方法 `address='

Email configuration in Redmine - undefined method `address='

我不是 Ruby 和 Redmine 方面的专家,但我正在尝试在 redmine 中配置电子邮件通知。 红矿3.4版 ruby2.3.3p222 Phusion 乘客 5.1.7

在configuration.yml我有

production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "xxxx.pl"
port: 587
authentication: :plain
domain: 'redmine.xxx.pl'
user_name: '.....@redmine.xxx.pl'
password: '......'

但是我得到这个错误:

Error ID: 54731089
  Error details saved to: /tmp/passenger-error-WqNBmN.html
  Message from application: undefined method `address=' for ActionMailer::Base:Class (NoMethodError)

我稍微搜索了一下,发现 application.rb 文件中缺少方法。

所以在 Redmine config/application.rb 我添加了类似的东西:

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address:              "xxx.pl",
port:                 587,
user_name:            'powiadomienia@redmine.xxx.pl',
password:            '.....',
authentication:       :plain
}

但还是出现同样的错误。不幸的是,我在 Redmine 配置中找不到任何示例。

谁能帮帮我?

确保 configuration.yml 正确缩进(每级缩进使用 2 个空格):

production:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: 'example.org'
      port: 587

smtp 设置(地址、端口等)需要是 smtp_settings 散列中的键。根据你得到的错误,我会说它们是与 smtp_settings 处于同一级别的键,这是错误的。