title: Form with file attachment
body: <p>I am using phpmailer for contact form. I added an attachment field for upload file/image in contact form using  . But i can not integrate php functions for file attachment. I am weak in php, but this is very important for me to add this in my contact form. </p>
  
  <p>Please someone help me. My form code and php code are given below. Thanks in advance.<br /><br /><br />
      //** This is html markup</p>
  
  <pre><code>&lt;form action="mobileapp.php" method="post" enctype="multipart/form-data"&gt;
  
   &lt;h2&gt;Your Contact Info&lt;/h2&gt;
    &lt;p&gt;Your First Name* &lt;br /&gt;
      &lt;input type="text" name="firstName" id="firstName" required /&gt;
    &lt;/p&gt;
    &lt;p&gt;Your Last Name* &lt;br /&gt;
      &lt;input type="text" name="lastName" id="lastName" required /&gt;
    &lt;/p&gt;
    &lt;p&gt;Your Email* &lt;br /&gt;
      &lt;input type="email" name="email" id="email" required /&gt;
    &lt;/p&gt;
    &lt;p&gt;Upload Your logo&lt;br /&gt;
      &lt;input type="file" name="uploaded_file" id="uploaded_file"&gt; 
    &lt;/p&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>//<em>*</em> This is the phpmailer code</p>
  
  <pre><code>  &lt;?php
  
    /* config start */
  
    $emailAddress = 'test@yourmail.com';
  
    /* config end */
  
  
    require "class.phpmailer.php";
  
  
    $msg=
    'First Name:'.$_POST['firstName'].'&lt;br /&gt;
    Last name:'.$_POST['lastName'].'&lt;br /&gt;
    Email:'.$_POST['email'].'&lt;br /&gt;
  
  
    ';
  
  
    $mail = new PHPMailer();
    $mail-&gt;IsMail();
  
    $mail-&gt;AddReplyTo($_POST['email'], $_POST['name']);
    $mail-&gt;AddAddress($emailAddress);
    $mail-&gt;SetFrom($_POST['email'], $_POST['name']);
    $mail-&gt;Subject = "Subject";
    $mail-&gt;MsgHTML($msg);
    $mail-&gt;Send();
  
    echo'&lt;script&gt; window.location="../index.html"; &lt;/script&gt; ';
  
    ?&gt;
  </code></pre>