title: Send mail using mail() function in PHP , XAMPP on LOCALHOST smtp GMAIL
body: <p>I do have to send some attchments with chunk_splits so i have to use simple mail function can not use other things like PHPMAILER, swiftMAILER,</p>
  
  <p>My Current Settings  PHP.ini</p>
  
  <pre><code>SMTP=smtp.gmail.com
  smtp_port=587
  
  sendmail_from=xyz@gmail.com
  
  sendmail_path = "\"D:\xampp\sendmail\sendmail.exe\" -t"
  </code></pre>
  
  <p>sendmial settings</p>
  
  <pre><code>smtp_port=587
  smtp_ssl=tls
  auth_username=xyz@gmail.com
  auth_password=xyz
  </code></pre>
  
  <p>are the settings correct ... i am able to send via YiiMail extension.. but becuase of some attachments i have to add so.. i can not do with that..</p>
  
  <p><strong>IN MAIL I HAVE TO DO THIS SO I CAN NOT USE OTHER THINGS LIKE SWIFT/PHP MAILER</strong></p>
  
  <p><strong>$pdf is TCPDF OBJECT i am attaching pdf on the go not saving on the local disk</strong></p>
  
  <pre><code>    $_SESSION['pdf'] = $pdf-&gt;Output("order_receipt.pdf", "S");  
  
      $attachment[0] = chunk_split(base64_encode($_SESSION['pdf']));
  
      $headers .= "--" . $separator . $eol;
      $headers .= "Content-Type: application/octet-stream; name=\"" . $lable[0] . "\"" . $eol;
      $headers .= "Content-Transfer-Encoding: base64" . $eol;
      $headers .= "Content-Disposition: attachment" . $eol . $eol;
      $headers .= $attachment[0] . $eol . $eol;
  </code></pre>