【问题标题】:CakePHP: send mail through SMTP to MS OUTLOOK -> SMTP Error: 504 5.7.4 Unrecognized authentication typeCakePHP:通过 SMTP 发送邮件到 MS OUTLOOK -> SMTP 错误:504 5.7.4 Unrecognized authentication type
【发布时间】:2013-01-26 10:01:09
【问题描述】:

我想在在这里写问题之前,我会尝试找出是否可以通过 cmd 行发送邮件。所以我关注了these steps 并通过 cmd 向我自己和我的一位同事发送了一封电子邮件,他正在开发与我相同的应用程序。来自 cmd 行的消息以应有的格式出现。

(内部应用程序,应该只向我同事的 OUTLOOK 帐户发送邮件)

一切似乎都很好,所以我认为我的 cakePHP 代码有错误:

到目前为止我的邮件代码都是这样的:

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 Unrecognized authentication type

【问题讨论】:

    标签: email cakephp outlook smtp


    【解决方案1】:

    已解决:

    我猜 EXCHANGE 不需要身份验证,所以我只是删除了密码参数并且工作正常。

    在研究过程中,我发现了这篇文章,所以下一步是联系 EXCHANGE 管理员。

    http://blogs.technet.com/b/exchange/archive/2006/12/28/3397620.aspx

    【讨论】:

      【解决方案2】:

      在端口 25 上使用 telnet 时,我遇到了同样的错误。改成587端口后,就可以使用经过身份验证的SMTP了。

      【讨论】:

        猜你喜欢
        • 2016-01-04
        • 2014-03-16
        • 2014-03-05
        • 1970-01-01
        • 1970-01-01
        • 2021-08-05
        • 1970-01-01
        • 1970-01-01
        • 2021-09-13
        相关资源
        最近更新 更多