title: How do I send email with JavaScript without opening the mail client?
body: <p>I'm writing a HTML page with a registration button that should just silently send an email without opening the local mail client. Here is my HTML:</p>
  
  <pre><code>&lt;form method="post" action=""&gt;
      &lt;input type="text" id="email_address" name="name" placeholder="Enter your email address..." required&gt;
      &lt;button onclick="sendMail(); return false"&gt;Send Email&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>... and here is my JavaScript code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    function sendMail() {
      var link = 'mailto:hello@domain.com?subject=Message from '
               +document.getElementById('email_address').value
               +'&amp;body='+document.getElementById('email_address').value;
      window.location.href = link;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>The code above works... but it opens the local email client. If I remove the <code>return</code> statement in the <code>onclick</code> attribute like this:</p>
  
  <pre><code>&lt;form method="post" action=""&gt;
      &lt;input type="text" id="email_address" name="name" placeholder="Enter your email address..." required&gt;
      &lt;button onclick="sendMail()"&gt;Send Email&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>... then the email is not sent at all. Am I missing something?</p>
  
  <p>Any help would be reeeally appreciated :-)</p>