CakePHP CakeMail向TLS Microsoft Exchange Server 2010发送电子邮件(托管在Godaddy的Exchange)

CakePHP CakeMail向TLS Microsoft Exchange Server 2010发送电子邮件(托管在Godaddy的Exchange),php,cakephp,exchange-server,Php,Cakephp,Exchange Server,我一直在尝试使用CakePHP(CakeMail)向Microsoft Exchange 2010服务器发送电子邮件的几种配置选项。这是我当前的配置: public $default = array( 'transport' => 'Smtp', 'from' => array('email@example.com' => 'Me'), 'host' => 'smtp.ex3.secureserver.net', 'port' =&

我一直在尝试使用CakePHP(CakeMail)向Microsoft Exchange 2010服务器发送电子邮件的几种配置选项。这是我当前的配置:

    public $default = array(
    'transport' => 'Smtp',
    'from' => array('email@example.com' => 'Me'),
    'host' => 'smtp.ex3.secureserver.net',
    'port' => 587,
    'timeout' => 30,
    'username' => 'verifiedUserName',
    'password' => 'verifiedPassword',
    'client' => null,
    'log' => true,
    'delivery' => 'smtp'
);
这是我的测试功能:

    public function test_email() {
    App::uses('CakeEmail', 'Network/Email');
    $email = new CakeEmail();
    $email->config('default');
    debug($email->config());
    $result = $email->template('checkout')
            ->from('email@example.com')
            ->emailFormat('text')
            ->to('another@example.com')
            ->subject('TEST EMAIL ')
            ->send();
}
我得到一份工作

SMTP Error: 504 5.7.4 Unrecognized authentication type
Unable to connect to SMTP server.
如果我将主机更改为'ssl://smtp.ex3.secureserver.net“或者”tls://smtp.ex3.secureserver.net“我得到了一份工作

SMTP Error: 504 5.7.4 Unrecognized authentication type
Unable to connect to SMTP server.
服务器配置为使用TLS

有什么想法吗?

你应该在$default配置中使用“tls”=>true。

你应该在$default配置中使用“tls”=>true。

(摘自本书)

从2.3.0开始,您还可以使用TLS选项启用TLS SMTP:

<?php
class EmailConfig {
    public $gmail = array(
        'host' => 'smtp.gmail.com',
        'port' => 465,
        'username' => 'my@gmail.com',
        'password' => 'secret',
        'transport' => 'Smtp',
        'tls' => true
    );
}
(摘自本书)

从2.3.0开始,您还可以使用TLS选项启用TLS SMTP:

<?php
class EmailConfig {
    public $gmail = array(
        'host' => 'smtp.gmail.com',
        'port' => 465,
        'username' => 'my@gmail.com',
        'password' => 'secret',
        'transport' => 'Smtp',
        'tls' => true
    );
}