title: Cakephp 2.x Mail connection with Office365
body: <p>I am developing an application where my client is using Office 365 for his emails , etc... I am trying to connect Cakephp mail with office 365 SMTP but without any success.
  Here is my code: </p>
  
  <pre><code>public $default = array(
      'from' =&gt; array('info@*****.com' =&gt; 'Company Name'),
      'transport' =&gt; 'Smtp',
      'host' =&gt; 'tls://smtp.office365.com',
      'port' =&gt; 587,
      'username' =&gt; 'info@*****.com',
      'password' =&gt; '*******',
      'client' =&gt; null,
      'log' =&gt; true,
      'tls' =&gt; true
  );
  </code></pre>
  
  <p>The error iam getting is Unable to connect to SMTP server. Also I tried the following hosts with and without tls:</p>
  
  <ol>
  <li>ssl://smtp-mail.outlook.com</li>
  <li>Smtp.mail.apac.microsoftonline.com (on this i was getting timeout error)</li>
  <li>pod51022.outlook.com</li>
  </ol>
  
  <p>Thanks.</p>