title: Pre-fill email with form data
body: <p>I am looking to have an HTML form that, using only JS/jQuery (no PHP), takes data from a "subject" and "message" field, and sends an email. I do not want the server to send the email, as HTML and JS are client-side, not server-side. Again, no PHP. </p>
  
  <p>However, I do want it to open the users mail client but have the subject and body pre-filled with the form data, and the to field prefilled with my email address. Essentially, I need a more advanced <code>mailto:test@test.com</code>.</p>
  
  <p>Here is my contact form so far:</p>
  
  <pre><code>&lt;h2&gt;Send a message&lt;/h2&gt;
  &lt;form id="sendmsg"&gt;
      &lt;div class="field"&gt;
          &lt;label for="subject"&gt;Subject&lt;/label&gt;
          &lt;input type="text" name="subject" id="subject" value="" /&gt;
      &lt;/div&gt;
      &lt;div class="field"&gt;
          &lt;label for="message"&gt;Message&lt;/label&gt;
          &lt;textarea name="body" id="body" rows="6"&gt;&lt;/textarea&gt;
      &lt;/div&gt;
      &lt;ul class="actions"&gt;
          &lt;li&gt;&lt;input type="submit" id="submit" value="Submit" /&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I have tried several attempts such as this (in jQuery):</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function() {
          $('#submit').click(function() {
              $('#sendmsg').attr('action', 'mailto:contact@test.com?subject=' + $('#subject').val() + '&amp;body=' + $('#body').val());
              $('#sendmsg').submit();
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Help is appreciated, thanks!</p>