title: How to send PDF attachment file in gmail using PHP?
body: <p>I want to send PDF attachment file in gmail account using php mailer (class.phpmailer.php) ?</p>
  
  <pre><code>&lt;?php
  require_once('phpmailer/class.phpmailer.php');
  $mail = new PHPMailer();
  $mail-&gt;From      = '';
  $mail-&gt;FromName  = '';
  $mail-&gt;Subject   = '';
  $MESSAGE_BODY = "Name: ".$username." "."\r\n"; 
  $MESSAGE_BODY .= "Contact No.: ".$contact." "."\r\n";
  $MESSAGE_BODY .= "Message: ".$message." "."\r\n";
  $mail-&gt;Body      = $MESSAGE_BODY;
  $mail-&gt;AddAddress( '' );
  $mail-&gt;AddAttachment($_FILES['file']['tmp_name'],
  $_FILES['file']['username']);
  if ($mail-&gt;Send())
  {   
    echo "Mail Sent";
  }
  else
  {
  echo "Could not send mail";
  }
  ?&gt;
  </code></pre>