无法通过 SMTP 使 ActionMailer 与 MS Exchange 一起工作 [英] Cannot get ActionMailer working with MS Exchange via SMTP
本文介绍了无法通过 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
- 使用 Telnet 连接到 Exchange 2003 POP3 邮箱并使用 SMTP 发送电子邮件以进行故障排除
- http://www.msexchange.org/tutorials/telnet-exchange2003-pop3-smtp-troubleshooting.html
- 向下滚动到:连接到 SMTP
- EHLO 返回了什么?
250-AUTH LOGIN
"或250-AUTH=LOGIN
"表示您需要进行身份验证.- "
250-AUTH
"(该行后面没有其他任何内容!)似乎表明您不应该对自己进行身份验证!否则你会得到错误:- 504 5.7.4 无法识别的身份验证类型"
- Using Telnet to connect to Exchange 2003 POP3 mailboxes and using SMTP to send e-mail for troubleshooting purposes
- http://www.msexchange.org/tutorials/telnet-exchange2003-pop3-smtp-troubleshooting.html
- Scroll down to: Connecting to SMTP
- What did EHLO return?
- "
250-AUTH LOGIN
" or "250-AUTH=LOGIN
" indicate that you need to authenticate. - "
250-AUTH
" (with nothing else following on that line!) seems to indicate that you should NOT authenticate yourself! Otherwise you will get the error:- "504 5.7.4 Unrecognized authentication type"
应该可以帮助您理解和解决问题的好资源.
Good resources that should help you to understand and troubleshoot it.
- EHLO 动词和 SMTP 扩展
(而不是改变您访问 Exchange 的方式)
(instead of changing how you access Exchange)
- 如何在 smtp 服务器 Exchange 2010 上启用身份验证登录
- (如Anil K Singh 所述,如何将 Exchange 2010 配置更改为接受来自第三方产品的邮件")
- (how to change the Exchange 2010 configuration to "accept mail from third part product" as mentioned by Anil K Singh)
- http://social.technet.microsoft.com/Forums/en-US/exchange2010/thread/93ad411a-0da2-4494-a45e-8cbb793aeca9/
对 Ruby on Rails 很有帮助
Helpful for Ruby on Rails
- 如何配置 Redmine 以邮寄到 MS Exchange 服务器
- http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Redmine_to_mail_to_MS_Exchange_server
- MS Exchange 不需要外发 (SMTP) 电子邮件的身份验证信息"
- 我的配置文件仍在 config/email.yml(在 Redmine 1.2 中)
- How to configure Redmine to mail to MS Exchange server
- http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Redmine_to_mail_to_MS_Exchange_server
- "MS Exchange will not require authentication information for outgoing (SMTP) email"
- My configuration file is still at config/email.yml (in Redmine 1.2)
这篇关于无法通过 SMTP 使 ActionMailer 与 MS Exchange 一起工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Redmine_to_mail_to_MS_Exchange_server
- http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Redmine_to_mail_to_MS_Exchange_server
- (how to change the Exchange 2010 configuration to "accept mail from third part product" as mentioned by Anil K Singh)
- (如Anil K Singh 所述,如何将 Exchange 2010 配置更改为接受来自第三方产品的邮件")
- 如何在 smtp 服务器 Exchange 2010 上启用身份验证登录
- "
- http://www.msexchange.org/tutorials/telnet-exchange2003-pop3-smtp-troubleshooting.html
- http://www.msexchange.org/tutorials/telnet-exchange2003-pop3-smtp-troubleshooting.html
查看全文