无法通过 SMTP 使 ActionMailer 与 MS Exchange 一起工作 [英] Cannot get ActionMailer working with MS Exchange via SMTP

查看:37
本文介绍了无法通过 SMTP 使 ActionMailer 与 MS Exchange 一起工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的简单测试程序(使用 ActionMailer 3.0.8,Ruby 1.9.2p180 Mac OS X):

Here's my simple test program (using ActionMailer 3.0.8, Ruby 1.9.2p180 Mac OS X):

require 'rubygems'
require 'action_mailer'

ActionMailer::Base.delivery_method = :smtp

ActionMailer::Base.smtp_settings = {
    :address => "my_exchange_server",
    :port => 25,
    :domain => 'my_domain.org',
    :authentication => :login,
    :user_name => 'my_user',
    :password => 'my_password',
    :enable_starttls_auto => false
}

ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.default :from => 'from_email@my_company.com'

m = ActionMailer::Base.mail :to => 'to_email@my_company.com', :subject => 'this is a test', :body => 'this is a test'
m.deliver

尝试各种身份验证类型时出现以下错误:

Trying various authentication types I get the following errors:

:普通错误:

smtp.rb:966:in `check_auth_response': 504 5.7.4 Unrecognized authentication type. (Net::SMTPAuthenticationError)

:登录错误:

smtp.rb:972:in `check_auth_continue': 504 5.7.4 Unrecognized authentication type. (Net::SMTPSyntaxError)

:cram_md5 错误:

:cram_md5 error:

smtp.rb:972:in `check_auth_continue': 504 5.7.4 Unrecognized authentication type. (Net::SMTPSyntaxError)

无身份验证错误:

protocol.rb:135:in `read_nonblock': end of file reached (EOFError)

有什么想法吗?

推荐答案

检查启用了哪些身份验证方案

可能是:none、plain、login、cram_md5、NTLM、StartTLS

Check what authentication schemes are enabled

It could be: none, plain, login, cram_md5, NTLM, StartTLS

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆