1.
      include("class.phpmailer.php");
   2.
      include("class.smtp.php");
   3. 
   4.
      $mail = new PHPMailer();
   5.
      $mail->IsSMTP();
   6.
      $mail->SMTPAuth = true;
   7.
      $mail->SMTPSecure = "ssl";
   8.
      $mail->Host = "smtp.gmail.com";
   9.
      $mail->Port = 465;
  10.
      $mail->Username = "
[email protected]";
  11.
      $mail->Password = "userpass"; 
http://blog.unijimpe.net/enviar-email-con-php-y-gmail/