title: Wordpress - Send Email with attachment
body: <p>This is my html section,please tell me what to pass in form action:</p>
  
  <pre><code>&lt;form action="" method="post" enctype="multipart/form-data"&gt;
  &lt;div class="inputtext"&gt;&lt;input type="text" placeholder="Fast Name*" name="fname"&gt;&lt;/div&gt;
  &lt;div class="inputtext"&gt;&lt;input type="text" placeholder="Email ID*" name="email"&gt;&lt;/div&gt;
  &lt;div class="inputtext"&gt;
    &lt;select name="bcontact"&gt;
    &lt;option value=""&gt;-- Best Way to Contact --&lt;/option&gt;
    &lt;option value="Phone"&gt;Phone&lt;/option&gt;
    &lt;option value="Email"&gt;Email&lt;/option&gt;
    &lt;/select&gt;&lt;/div&gt;
  &lt;div class="inputtext"&gt;&lt;input type="text" placeholder="Years Of Experience" name="experience"&gt;&lt;/div&gt;
  &lt;div class="inputtext"&gt;&lt;input type="file" name="uploaded_file"&gt;&lt;/div&gt;
  &lt;div class="input100per"&gt;&lt;textarea placeholder="How can we help you?" rows="5" name="message"&gt;&lt;/textarea&gt;&lt;/div&gt;
  &lt;div class="input100per"&gt;&lt;input type="submit" value="Submit" name="submit"&gt;
  &lt;div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Code:
  I need to send an email with attachment like pdf /word document.</p>
  
  <pre><code> if ( isset( $_POST['submit'] ) ) {
   global $wpdb;
   $to ='test@gmail.com';
   $from = 'test@gmail.com'; 
   $name = get_bloginfo('name');
   $attachment = $_POST['file'];
   $headers  = 'MIME-Version: 1.0' . "\r\n";
   $headers .= 'Content-type: multipart/mixed; charset=iso-8859-1' . "\r\n";
   $headers .= 'From: ' . $name . ' &lt;' . $from . '&gt;' . "\r\n";   
   $subject = 'Testing';
   $msg = 'Yay!';
   $mail_attachment = array( $attachment );
   wp_mail($to, $subject, $msg, $headers, $mail_attachment);
   echo 'Email sent';
   } else {
   echo 'Email not sent';
   }
  </code></pre>
  
  <p>Please find me out the solution. Thanks!</p>