title: Mail.php & Smtp Authentication Issue
body: <p>I've been trying to utilize a mail.php file from the jquery contactable plugin (found on google!) to use on my website. Although the script provided is fairly simple I'm running into issues with integrating it with my Host's SMTP requirement. Here is the original script without SMTP authentication: </p>
  
  <pre><code>&lt;?php
      // Assign contact info
      $name = stripcslashes($_POST['name']);
      $emailAddr = stripcslashes($_POST['email']);
      $issue = stripcslashes($_POST['issue']);
      $comment = stripcslashes($_POST['message']);
      $subject = stripcslashes($_POST['subject']);    
  
      // Set headers
      $headers  = 'MIME-Version: 1.0' . "\r\n";
      $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  
      // Format message
      $contactMessage =  
      "&lt;div&gt;
      &lt;p&gt;&lt;strong&gt;Name:&lt;/strong&gt; $name &lt;br /&gt;
      &lt;strong&gt;E-mail:&lt;/strong&gt; $emailAddr &lt;br /&gt;
      &lt;strong&gt;Issue:&lt;/strong&gt; $issue &lt;/p&gt;
  
      &lt;p&gt;&lt;strong&gt;Message:&lt;/strong&gt; $comment &lt;/p&gt;
  
      &lt;p&gt;&lt;strong&gt;Sending IP:&lt;/strong&gt; $_SERVER[REMOTE_ADDR]&lt;br /&gt;
      &lt;strong&gt;Sent via:&lt;/strong&gt; $_SERVER[HTTP_HOST]&lt;/p&gt;
      &lt;/div&gt;";
  
      // Send and check the message status
      $response = (mail('mymail@mymail.com', $subject, $contactMessage, $headers) ) ? "success" : "failure" ;
      $output = json_encode(array("response" =&gt; $response));
  
      header('content-type: application/json; charset=utf-8');
      echo($output);
  
  ?&gt;
  </code></pre>
  
  <p>I've tried using suggestions from Google and played around with it for hours. Here is the latest version based on my nil-understanding of php thus far. -__- (Based on this: <a href="http://blog.geek4support.com/php-mail-script-with-smtp-authentication-how-to-send-mails-by-php-mail-script-using-smtp-authetication/" rel="nofollow">http://blog.geek4support.com/php-mail-script-with-smtp-authentication-how-to-send-mails-by-php-mail-script-using-smtp-authetication/</a>)</p>
  
  <pre><code>&lt;?php
   require_once "Mail.php";
  
      // Assign contact info
      $name = stripcslashes($_POST['name']);
      $emailAddr = stripcslashes($_POST['email']);
      $issue = stripcslashes($_POST['issue']);
      $comment = stripcslashes($_POST['message']);
      $subject = stripcslashes($_POST['subject']);    
  
  
   $host = "mail.mywebsite.com";
   $username = "mywebsitemail@mywebsiteaddress.com";
   $password = "mymailpassword";
  
      // Set headers
      $headers  = 'MIME-Version: 1.0' . "\r\n";
      $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  
      // Format message
      $contactMessage =  
      "&lt;div&gt;
      &lt;p&gt;&lt;strong&gt;Name:&lt;/strong&gt; $name &lt;br /&gt;
      &lt;strong&gt;E-mail:&lt;/strong&gt; $emailAddr &lt;br /&gt;
      &lt;strong&gt;Issue:&lt;/strong&gt; $issue &lt;/p&gt;
  
      &lt;p&gt;&lt;strong&gt;Message:&lt;/strong&gt; $comment &lt;/p&gt;
  
      &lt;p&gt;&lt;strong&gt;Sending IP:&lt;/strong&gt; $_SERVER[REMOTE_ADDR]&lt;br /&gt;
      &lt;strong&gt;Sent via:&lt;/strong&gt; $_SERVER[HTTP_HOST]&lt;/p&gt;
      &lt;/div&gt;";
  
   $smtp = Mail::factory('smtp',
     array ('host' =&gt; $host,
       'auth' =&gt; true,
       'username' =&gt; $username,
       'password' =&gt; $password));
  
  
   $response = ($smtp-&gt;send('mymail@mymail.com', $subject, $contactMessage, $headers))  ? "success": "failure";
  $output = json_encode(array("response" =&gt; $response));  
      header('content-type: application/json; charset=utf-8');
      echo($output);
  
   ?&gt;
  </code></pre>
  
  <p>I've actually run into a bit of a problem. My host doesn't support PHPMailer :-(. Only PearMail with SMTP. They have suggested tweaking the code listed above and incorporating my existing one with it. Exactly, what I've been trying to do before posting this online. Back to square 1, any ideas? </p>
  
  <p>Comments, suggestions, anything would be most appreciated! :-)</p>