title: PhP Mailer Adding attachments
body: <p>Community, I am testing out a very basic form where I can select a single file and send the file to myself.  I have looked at a few other members postings and have followed very similar steps.  below is my html and php.  It will send the email, but won't attach the file.  Any suggestions as to what I'm doing wrong or if I'm missing anything?</p>
  
  <pre><code>&lt;form method="post" enctype="multipart/form-data" action="&lt;?php echo htmlspecialchars($_SERVER['PHP']);?&gt;"&gt;
  &lt;label for="file"&gt;Filename:&lt;/label&gt;
  &lt;input type="file" name="file" id="file"&gt;&lt;br&gt;
  &lt;input type="submit" name="submit" value="Submit"&gt;
  &lt;/form&gt;
  &lt;?php
  if($_POST['submit'] == 'Submit')
  {
      require("class.phpmailer.php");
      $mail = new PHPMailer();
      $mail-&gt;From = "*****@*****.com";
      $mail-&gt;AddAddress("*****@******.com");
      $mail-&gt;Subject = "Test";
      $mail-&gt;Body = "HI";
      $mail-&gt;AddAttachment($_FILES['file']['tmp_name'], $_FILES['file']['name']);
      if(!$mail-&gt;Send())
      {
          echo 'Message was not sent.';
          echo 'Mailer error:'.$mail-&gt;ErrorInfo;
      }
      else
      {
          echo 'Message has been sent';
      }
  }
  ?&gt;
  </code></pre>