代码之家  ›  专栏  ›  技术社区  ›  KacproSo

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

  •  1
  • KacproSo  · 技术社区  · 7 年前

    Redmine版本3.4 Phusion乘客5.1.7

    在配置中。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)
    

    我搜索了一下,发现我在应用程序中缺少了一些方法。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配置中找不到任何示例。

    有人能帮我吗?

    1 回复  |  直到 7 年前
        1
  •  1
  •   jkraemer    7 年前

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

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

    smtp设置(地址、端口等)需要是 smtp_settings