title: Send email from localhost to Gmail
body: <p>I am new to PHP &amp; want to we send email from localhost to my gmail address.</p>
  
  <p>I am using ubuntu 9.10 &amp; have already installed libphp-phpmailer from Synaptic Package manager option.</p>
  
  <p>I used:</p>
  
  <pre><code>$to      = "abc@gmail.com";
  $subject = "Account Confirmation";
  $headers = "From: xyz@gmail.com";
  $message = "Testing";
  $mail = mail($to, $subject, $message, $headers);
  
  if ($mail) {
      echo "Mail sent.";
  } else {
     echo "Some Error occur.";
  }
  </code></pre>
  
  <p>And it show Some Error occur.</p>