I’ve been trying several configuration options to send email using CakePHP (CakeMail) to a Microsoft Exchange 2010 Server. This is my current configuration:
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'
);
And this is my testing function:
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();
}
I’m getting a
SMTP Error: 504 5.7.4 Unrecognized authentication type
If i change the host to ‘ssl://smtp.ex3.secureserver.net’ or ‘tls://smtp.ex3.secureserver.net’ i’m getting a
Unable to connect to SMTP server.
The server is configured to use TLS.
Any ideas ?
(from the book)
http://book.cakephp.org/2.0/en/core-utility-libraries/email.html#configuration
As of 2.3.0 you can also enable TLS SMTP using the tls option:
ref to feature pull request here > https://github.com/cakephp/cakephp/pull/734