title: Send Email using Outlook through PHP Pear
body: <p>I'm trying to send an email using PHP Pear. It works when I send email using Gmail with this settings:</p>
  
  <pre><code>$smtp = Mail::factory('smtp', array(
      'host' =&gt; 'ssl://smtp.gmail.com',
      'port' =&gt; '465',
      'auth' =&gt; true,
      'username' =&gt; 'username@gmail.com',
      'password' =&gt; 'password!2016'
  ));
  </code></pre>
  
  <p>But before I make this work, I have to "allow less secure apps" to access my account, which you can read <a href="https://support.google.com/accounts/answer/6010255?hl=en" rel="nofollow">here</a> on how to do it.</p>
  
  <p>I tried to use an Outlook account with this settings:</p>
  
  <pre><code>$smtp = Mail::factory('smtp', array(
      'host' =&gt; 'tls://smtp.office365.com',
      'port' =&gt; '587',
      'auth' =&gt; true,
      'username' =&gt; 'email@domain.org',
      'password' =&gt; 'greatPasswordComesWithGreatResponsibilities'
  ));
  </code></pre>
  
  <p>but I get this error:</p>
  
  <blockquote>
    <p>Failed to connect to ssl://smtp.office365.com:587 [SMTP: Failed to connect socket: fsockopen(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) (code: -1, response: )]</p>
  </blockquote>
  
  <p>I checked the <a href="https://support.office.com/en-us/article/POP-and-IMAP-settings-for-Outlook-Office-365-for-business-7fc677eb-2491-4cbc-8153-8e7113525f6c" rel="nofollow">official article</a> by Microsoft regarding their SMTP settings. So I thought I have the right settings, but it's not working.</p>
  
  <p>Am I missing something? Why do I get this error? Is there a setting I have to configure in my outlook account, like with the Gmail, before a third party app be allowed to send email? </p>