title: PHP PEAR Mail Error
body: <p>I'm getting an error with the following code when trying to send an email. It works on my local machine but not when I put it on my AWS LAMP server.  I cannot debug anything because I'm getting an HTTP 500 error when I run the script.  However, I know PEAR is installed.</p>
  
  <p>Code:</p>
  
  <pre><code>require_once "Mail.php";
  
  $from = "Email&lt;Test@example.com&gt;";
  $to = "steve@exmaple.com";
  $subject = "ERROR REPORT";
  $body = "test message";
  
  $host = "ssl://smtp.gmail.com";
  $port = "465";
  $username = "test@gmail.com";
  $password = "pass1";
  
  $headers = array ('From' =&gt; $from,
      'To' =&gt; $to,
      'Subject' =&gt; $subject);
  
  $smtp = Mail::factory('smtp',
  array ('host' =&gt; $host,
      'port' =&gt; $port,
      'auth' =&gt; true,
      'username' =&gt; $username,
      'password' =&gt; $password));
  
  
  $mail = $smtp-&gt;send($to, $headers, $body);
  
  
  if (PEAR::isError($mail)) {
      echo("&lt;p&gt;" . $mail-&gt;getMessage() . "&lt;/p&gt;");
      } else {
      echo("Error message sent!");
  }
  </code></pre>
  
  <p>It appears to be bugging out at the send() command above. Any suggestions on how to better debug this?</p>