ActionMailer无法通过SMTP与MS Exchange一起工作 [英] Cannot get ActionMailer working with MS Exchange via SMTP
本文介绍了ActionMailer无法通过SMTP与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 =登录
表示您需要进行身份验证。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扩展名
- The EHLO verb and SMTP extensions
- http://cr.yp.to/smtp/ehlo.html
- http://www.samlogic.net/articles/smtp-commands-reference-auth.htm
- http://www.expta.com/2010/03/how-to-use-telnet-to-send-smtp-email-to.html
- http://www.dasblinkenlichten.com/?p=190
(而不是更改访问Exchange的方式)
(instead of changing how you access Exchange)
- 如何在smtp服务器交换上启用认证登录2010
- How to enable auth login on smtp server exchange 2010
- http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_26538583.html
- http://www.advancedintellect.com/post/2011/03/02/Exchange-2010-and-SMTP-settings.aspx
- 将Exchange 2010配置更改为接受来自第三方产品的邮件,如 Anil K Singh所述)
- (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)电子邮件的身份验证信息
- 我的配置文件仍在配置/电子邮件.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)
- 请参阅来自的回答
- Unrecognized authentication type when doing an Auth to Exchange from Rails
- http://www.redmineblog.com/articles/setup-redmine-to-send-email-using-gmail/
这篇关于ActionMailer无法通过SMTP与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)
- How to enable auth login on smtp server exchange 2010
- The EHLO verb and SMTP extensions
- "
- http://www.msexchange.org/tutorials/telnet-exchange2003-pop3-smtp-troubleshooting.html
- http://www.msexchange.org/tutorials/telnet-exchange2003-pop3-smtp-troubleshooting.html
查看全文