title: file upload field attach file to email
body: <p>Have got a simple HTML form with file upload field:</p>
  
  <pre><code>    &lt;form action="&lt;?php bloginfo('template_url'); ?&gt;/demo-contacts.php" method="post" id="sky-form" class="sky-form" enctype="multipart/form-data"&gt;
        &lt;header&gt;Submit an &lt;strong&gt;Application!&lt;/strong&gt;&lt;/header&gt;
        &lt;fieldset&gt;
          &lt;div class="row"&gt;
            &lt;section class="col col-6"&gt;
              &lt;label class="label"&gt;Name&lt;/label&gt;
              &lt;label class="input"&gt; &lt;i class="icon-append icon-user"&gt;&lt;/i&gt;
                &lt;input type="text" name="name" id="name"&gt;
              &lt;/label&gt;
            &lt;/section&gt;
            &lt;section class="col col-6"&gt;
              &lt;label class="label"&gt;E-mail&lt;/label&gt;
              &lt;label class="input"&gt; &lt;i class="icon-append icon-envelope-alt"&gt;&lt;/i&gt;
                &lt;input type="email" name="email" id="email"&gt;
              &lt;/label&gt;
            &lt;/section&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
            &lt;section class="col col-6"&gt;
              &lt;label class="label"&gt;Telephone Number&lt;/label&gt;
              &lt;label class="input"&gt; &lt;i class="icon-append icon-phone"&gt;&lt;/i&gt;
                &lt;input type="text" name="telephone" id="telephone"&gt;
              &lt;/label&gt;
            &lt;/section&gt;
            &lt;section class="col col-6"&gt;
              &lt;label class="label"&gt;Address&lt;/label&gt;
              &lt;label class="input"&gt; &lt;i class="icon-append icon-envelope-alt"&gt;&lt;/i&gt;
                &lt;input type="text" name="address" id="address"&gt;
              &lt;/label&gt;
            &lt;/section&gt;
          &lt;/div&gt;
          &lt;section&gt;
            &lt;label class="label"&gt;Subject&lt;/label&gt;
            &lt;label class="input"&gt; &lt;i class="icon-append icon-tag"&gt;&lt;/i&gt;
            &lt;input type="text" name="subject" id="subject" value="Technician Application"&gt;
            &lt;/label&gt;
          &lt;/section&gt;
          &lt;section&gt;
            &lt;label class="label"&gt;Covering Letter&lt;/label&gt;
            &lt;label class="textarea"&gt; &lt;i class="icon-append icon-comment"&gt;&lt;/i&gt;
              &lt;textarea rows="4" name="message" id="message"&gt;&lt;/textarea&gt;
            &lt;/label&gt;
          &lt;/section&gt;
      &lt;div class="row"&gt;
            &lt;section class="col col-6"&gt;
              &lt;label class="label"&gt;Attach your CV&lt;/label&gt;
              &lt;label class="input"&gt; &lt;i class="icon-append icon-file"&gt;&lt;/i&gt;
                &lt;input type="file" name="cv" id="cv"&gt;
              &lt;/label&gt;
            &lt;/section&gt;
      &lt;/div&gt;
      &lt;input type="hidden" name="recipient" value="&lt;?php the_field('contact_form_recipient'); ?&gt;"&gt;
        &lt;/fieldset&gt;
        &lt;footer&gt;
          &lt;button type="submit" class="button"&gt;Send&lt;/button&gt;
        &lt;/footer&gt;
        &lt;div class="message"&gt; &lt;i class="icon-ok"&gt;&lt;/i&gt;
          &lt;p&gt;Your message was successfully sent!&lt;/p&gt;
        &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>And have the following PHP to process the form which worked well prior to adding file upload field:</p>
  
  <pre><code>$EmailFrom = "email address here";
  $EmailTo = Trim(stripslashes($_POST['recipient']));
  $Name = Trim(stripslashes($_POST['name'])); 
  $Subject = Trim(stripslashes($_POST['subject'])); 
  $Email = Trim(stripslashes($_POST['email'])); 
  $Telephone = Trim(stripslashes($_POST['telephone'])); 
  $Address = Trim(stripslashes($_POST['address'])); 
  $Message = Trim(stripslashes($_POST['message'])); 
  $CV = Trim(stripslashes($_POST['cv'])); 
  
  // prepare email body text
  $Body = "";
  $Body .= "Name: ";
  $Body .= $Name;
  $Body .= "\n";
  $Body .= "Email: ";
  $Body .= $Email;
  $Body .= "\n";
  $Body .= "Telephone: ";
  $Body .= $Telephone;
  $Body .= "\n";
  $Body .= "Address: ";
  $Body .= $Address;
  $Body .= "\n";
  $Body .= "Message: ";
  $Body .= $Message;
  $Body .= "\n";
  $Body .= "CV: ";
  $Body .= $CV;
  $Body .= "\n";
  
  // send email 
  $success = mail($EmailTo, $Subject, $Body, "From: &lt;$EmailFrom&gt;");
  
  // redirect to success page 
  if ($success){
    print "&lt;meta http-equiv=\"refresh\" content=\"0;URL= URL here\"&gt;";
  }
  else{
    echo "failed";
  }
  </code></pre>
  
  <p>At present, the e-mail that comes through just states the name of the file that's been uploaded, i'd like to have the file attached to the email, could someone guide me please?</p>
  
  <p>Thanks</p>