如何使用php邮件发送文件

I just went through this answer HERE, as how to send a file in PHP using PHP mailer, so i have the following HTML code:

<form action="./php/send-file.php" method="post" enctype="multipart/form-data">
              <input type="file" name="files" id="filer_input" multiple="multiple">
              <input type="submit" value="Submit">
</form>

PHP code as below:

require_once('class.phpmailer.php');

$email = new PHPMailer();
$email->From      = 'gautam@webmunky.com';
$email->FromName  = 'Your Name';
$email->Subject   = 'Message Subject';
$email->AddAddress( 'gautam@webmunky.com' );

<!-- $file_to_attach = $_FILES['files']; -->
$email->AddAttachment( $_FILES['files']['tmp_name'],
                         $_FILES['files']['name'] );
return $email->Send();

I beleive i am making a mistake in the below two lines of code:

<!-- $file_to_attach = $_FILES['files']; -->
$email->AddAttachment( $_FILES['files']['tmp_name'],
                         $_FILES['files']['name'] );

but i am not sure , can somebody guide me as to how i can send my file using the above PHP code ?

Thank you.

Pretty sure this is a syntax error

<?php
      <!-- $file_to_attach = $_FILES['files']; -->

This is an HTML comment, when you want a PHP comment.

<?php
  //$file_to_attach = $_FILES['files'];

Or even

<?php
  #$file_to_attach = $_FILES['files'];