【问题标题】:Can't connect to exchange server to send mail via SMTP in ruby无法连接到交换服务器以在 ruby​​ 中通过 SMTP 发送邮件
【发布时间】:2013-02-01 08:22:24
【问题描述】:

我已经尝试了我能想到的一切。我已经尝试了所有我能想到的身份验证类型。
这是我的设置

delivery_method :smtp, { 
                       :address              => "xxxxxxxxx.com",
                       :port                 => port,
                       :domain               => 'xxxxxx.com',
                       :user_name            => 'username',
                       :password             => "passworde",
                       :authentication       => 'plain',
                       :enable_starttls_auto => true  }

如果我使用端口 25,这是我的错误(我相信这是正确的端口)

c:/Ruby193/lib/ruby/1.9.1/net/smtp.rb:960:in `check_auth_response': 504 5.7.4 Unrecognized authentication type (Net::SMTPAuthenticationError)

如果我使用端口 587,这是我的错误

c:/Ruby193/lib/ruby/1.9.1/openssl/ssl-internal.rb:121:in `post_connection_check': hostname does not match the server certificate (OpenSSL::SSL::SSLError)

【问题讨论】:

    标签: ruby smtp exchange-server


    【解决方案1】:

    您传递的哈希值应将:plain 定义为符号,而不是ActionMailer::Base docs 中的字符串。服务器肯定在端口 25 上响应(即 504 5.7.4 Unrecognized authentication type error 来自服务器)所以坚持使用该端口。

    也可能是您的服务器上禁用了普通身份验证。查看Cannot get ActionMailer working with MS Exchange via SMTP 了解更多信息。

    【讨论】:

    • 将身份验证更改为 :plain 不会更改错误
    • 听起来您的 Exchange 服务器可能禁用了普通身份验证。查看这个类似的问题,了解有关在您的服务器上启用什么的信息:stackoverflow.com/questions/6523348/…
    猜你喜欢
    • 1970-01-01
    • 2018-06-30
    • 2010-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-07
    • 1970-01-01
    相关资源
    最近更新 更多