CakePHP:通过SMTP将邮件发送到MS OUTLOOK-> SMTP错误:504 5.7.4无法识别的身份验证类型 [英] CakePHP: send mail through SMTP to MS OUTLOOK -> SMTP Error: 504 5.7.4 Unrecognized authentication type
问题描述
我认为在尝试在此处提出问题之前,我会尝试找出是否可以通过cmd行发送邮件.因此,我遵循了这些步骤,并通过cmd发送了一封电子邮件给自己和我的一个同事我在同一个应用程序上工作.来自cmd行的消息以应有的格式出现.
I figured that I'll try to find out if I can send mails via cmd line before writing a question here. So I followed these steps and sent an e-mail by cmd to myself and a collegue of mine who's working on the same app I am. The message from cmd line came in the format it should have come.
(内部应用程序,应仅将邮件发送到我同事的OUTLOOK帐户)
( internal app, should send mails only to my collegues' OUTLOOK accounts )
一切似乎都很好连接,所以我发现我的cakePHP代码中有一个错误:
Everything seems to be connected fine so I figured I have an error in my cakePHP code:
到目前为止,我收到的所有邮件代码都是:
Everything on mails code I have so far is this:
app/config/email.php
public $smtp = array(
'transport' => 'Smtp',
'from' => array('from@test.sk'),
'host' => 'ip_address_of_my_host',
'port' => 25,
'timeout' => 30,
'username' => 'from@test.com',
'password' => 'password',
'client' => null,
'log' => true,
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
);
UsersController.php(测试发送邮件功能)
public function test_send_email() {
$this->autoRender = false;
App::uses('CakeEmail', 'Network/Email');
$email = new CakeEmail('smtp');
$email->from(array('from@test.com' => 'APP TEST'));
$email->to('me@test.com');
$email->subject('Subject of testing');
$email->send('Message of testing');
}
加载5秒后,我得到: SMTP错误:504 5.7.4无法识别的身份验证类型
After 5 seconds of loading I get: SMTP Error: 504 5.7.4 Unrecognized authentication type
推荐答案
已解决:
我猜想EXCHANGE不需要身份验证,所以我只是删除了password参数即可正常工作.
I guess the authentication wasnt required on EXCHANGE, so I just removed the password parameter and works fine.
在研究过程中,我发现了本文,因此下一步就是联系EXCHANGE管理员.
During research I found out this article, so the next step would be to contact EXCHANGE admins.
http://blogs.technet.com/b/exchange/archive/2006/12/28/3397620.aspx
这篇关于CakePHP:通过SMTP将邮件发送到MS OUTLOOK-> SMTP错误:504 5.7.4无法识别的身份验证类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!