6

配置.yml

development:
   email_delivery:
     delivery_method: :smtp
     smtp_settings:
      #tls: true
       #enable_starttls_auto: true
       openssl_verify_mode: 'none'
       address: "domain name" 
       port: 25
       authentication: :login
       domain: 'mail domail name'
       user_name: 'mail id'
       password: 'pwd'

此代码用于发生以下错误

发送邮件时出错:

SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol


development:
email_delivery:
delivery_method: :smtp
smtp_settings:
tls: true
enable_starttls_auto: true
openssl_verify_mode: 'none'
address: "domain name" 
port: 587
authentication: :login
domain: 'mail domail name'
user_name: 'mail id'
password: 'pwd'

此代码用于发生以下错误

发送邮件时出错:

No connection could be made because the target machine actively refused it. - connect(2)


development:
email_delivery:
delivery_method: :async_smtp
smtp_settings:
tls: true
enable_starttls_auto: true
openssl_verify_mode: 'none'
address: "domain name" 
port: 25
authentication: :login
domain: 'mail domail name'
user_name: 'mail id'
password: 'pwd'

没有发生错误但仍然没有收到用户的邮件。

development:
email_delivery:
delivery_method: :smtp
smtp_settings:
tls: true
enable_starttls_auto: true
openssl_verify_mode: 'none'
address: "domain name" 
port: 25
authentication: :login
domain: 'mail domail name'
user_name: 'mail id'
password: 'pwd'

此代码使用 redmine 版本 2.2.3 可以正常使用。但现在使用的 2.3.0 版无法正常工作。

4

1 回答 1

11

在与这个问题斗争了几个小时之后,这就是我想出的(对我有用)

email_delivery:
  delivery_method: smtp
  smtp_settings:
    openssl_verify_mode: none
    tls: false
    enable_starttls_auto: true
    address: smtp.xxx.xx
    port: 587
    domain: xxx.xx
    authentication: login
    user_name: "xxx@xxx.xx"
    password: xxx

确保地址与域匹配并且可以解析

于 2013-07-07T10:25:33.207 回答