title: cant send email with php-pear 5.6
body: <p>I have a php scrip that emails. After the recent update to php and php-pear to 5.6 it no longer works and I get a authentication error.</p>
  
  <pre><code>$from = "no-reply@mydomain.net";
   $port = "587";
   $to=$d_uname;
   $host = "smtp.sendgrid.net";
   $username = "username";
   $password = "password";
  
           $headers = array ('From' =&gt; $d_replyto,
             'To' =&gt; $to,
             'Subject' =&gt; $d_subject,
         'MIME-Version' =&gt; "1.0",
         'Content-type' =&gt; "text/plain; charset=utf-8",
       );
           $smtp = Mail::factory('smtp',
             array ('host' =&gt; $host,
               'port' =&gt; $port,
               'auth' =&gt; true,
               'username' =&gt; $username,
               'password' =&gt; $password));
  
   #Email it
   if (PEAR::isError($smtp)) {
       error_log("&lt;p&gt;" . $smtp-&gt;getMessage() . "&lt;/p&gt;");
      }
   $mail = $smtp-&gt;send($to, $headers, $d_message);
  </code></pre>
  
  <p>When trying to send emails this way I get the following error:</p>
  
  <pre><code>authentication failure [SMTP: STARTTLS failed (code: 220, response: Begin TLS negotiation now)]
  </code></pre>
  
  <p>Any ideas what's wrong here? Downgrading PHP and PHP-pear resolves the issue.</p>
  
  <p>Cheers!</p>