title: Add attachment to email from contact form submission
body: <p>I want to receive the file uploaded in my form as an email attachment. At the minute it sends a confirmation email but with no attachment. I think I would need to add it as a string attachment.</p>
  <p>e.g
  When a user applies for a role on my website, I would like to receive the CV ($cv) as an email attachment.</p>
  <p>Here's my code so far:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  
  if (!defined('ABSPATH'))
      exit;
  
  class IWJ_Email {
      public static function get_blogname() {
          return wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
      }
  
      static public function send_email($type, $args, $method = '') {
  
          $emails = self::get_emails($type, $args);
          if($emails){
              $email_queue_types = (array)apply_filters('iwj_email_queue_types', array('new_job', 'alert_job'));
              foreach ($emails as $email){
                  if ($email['content'] &amp;&amp; $email['recipients'] &amp;&amp; $email['subject']) {
                      //add mail queue
                      $from_name = self::get_blogname();
                      $from_address = get_bloginfo('admin_email');
  
                      $mailqueue =  ($method &amp;&amp; $method == 'mailqueue') ? true : ($method == 'direct' ? false : in_array($type, $email_queue_types));
                      do_action('iwj_before_send_email', $email, $mailqueue, $type, $args);
                      if($mailqueue){
                          IWJ_Email_Queue::add($from_name, $from_address, $email['recipients'], $email['subject'], $email['content']);
                      }else{
                          //send directly
                          $headers = array();
                          $headers[] = 'Content-Type: text/html; charset=UTF-8';
  
                          $headers[] = 'From: ' . $from_name . ' &lt;' . $from_address . '&gt;';
                          if(isset($email['reply_name']) &amp;&amp; isset($email['reply_to'])){
                              $headers[] = 'Reply-To: ' . $email['reply_name'] . ' &lt;' . $email['reply_to'] . '&gt;';
                          }elseif(isset($email['reply_to'])){
                              $headers[] = 'Reply-To: &lt;' . $email['reply_to'] . '&gt;';
                          }
  
                          wp_mail($email['recipients'], $email['subject'], $email['content'], $headers);
                      }
                      do_action('iwj_after_send_email', $email, $mailqueue, $type, $args);
                  }
              }
          }
      }
  
      static public function get_email_new_application_employer($args) {
          $type = 'new_application_employer';
          $enable_email = iwj_option('email_'.$type.'_enable');
          if ($enable_email) {
              $application = $args;
              $job = $application-&gt;get_job();
              $job_author = $job-&gt;get_author();
              $user = IWJ_User::get_user();
              $user_name = $application-&gt;get_full_name();
              $user_email = $application-&gt;get_email();
  
              $recipient = $job-&gt;get_email_for_apply();
              $heading = iwj_option('email_' . $type . '_heading');
              $subject = iwj_option('email_' . $type . '_subject');
              $content = iwj_option('email_' . $type . '_content');
  
              $args = array(
                  'job' =&gt; $job,
                  'job_title' =&gt; $job-&gt;get_title(),
                  'employer' =&gt; $job_author,
                  'employer_name' =&gt; $job_author-&gt;get_display_name(),
                  'employer_email' =&gt; $job_author-&gt;get_email(),
                  'candidate' =&gt; $user,
                  'candidate_name' =&gt; $user_name,
                  'candidate_email' =&gt; $user_email,
                  'application' =&gt; $application,
              );
  
              $email = array(
                  'subject' =&gt; $subject,
                  'heading' =&gt; $heading,
                  'content' =&gt; $content,
                  'recipients' =&gt; $recipient,
                  'args' =&gt; $args,
              );
  
              return array($email);
          }
  
          return array();
      }
  
  }</code></pre>
  </div>
  </div>
  </p>
  <p>Any help would be really appreciated!</p>