title: Send attachment to email using wp_mail
body: <p>I am using wordpress 4.4.2.</p>
  
  <p>Code of form for file type:</p>
  
  <pre><code>&lt;input placeholder="'.__( 'Select File', 'mk_framework' ).'" type="file" name="file" id="file" class="contact_file file-form select-input full"/&gt;
  </code></pre>
  
  <p>I have used following code for upload file and send attachment to email.</p>
  
  <pre><code>if ( ! function_exists( 'wp_handle_upload' ) ) {
    require_once( ABSPATH . 'wp-admin/includes/file.php' );
  }
  $uploadedfile = $_FILES['file'];
  $upload_overrides = array( 'test_form' =&gt; false );
  $movefile = wp_handle_upload( $uploadedfile, $upload_overrides );
  if ( $movefile &amp;&amp; ! isset( $movefile['error'] ) ) {
    echo "File is valid, and was successfully uploaded.\n";
    var_dump( $movefile );
    $attachments = $movefile[ 'file' ];
  } else {
    echo $movefile['error'];
  }
  
  wp_mail($to, $subject, $body, $headers, $attachments);
  </code></pre>
  
  <p>I have also increase size of 'upload_max_filesize and 'post_max_size' variables in php.ini but can't get an attachment to email.</p>
  
  <p>But still it will giving me error like: </p>
  
  <blockquote>
    <p>File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.</p>
  </blockquote>
  
  <p>So is there any way to do this?
  Any help/suggestion would be appreciated. </p>