title: Send email with JavaScript
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1415205/how-to-send-email-by-using-javascript-or-jquery">how to send email by using javascript or jquery</a>  </p>
  </blockquote>
  
  
  
  <p>How can I send an email with JavaScript, that is able to be read by Gmail, Yahoo, etc.?</p>
  
  <p>This is what I have:</p>
  
  <pre><code>&lt;script language="javascript"&gt;
  
         function SendEmail()
         {
             var body = escape(document.Form.textfieldName.value +"\n"+document.Form.textfieldEmail.value +"\n"+document.Form.textfieldMessage.value);
  
      var sTo="testmail@mail.com";
  
             var subject = "This is SyntaxHelpSub";
  
                             window.location.href =
      "mailto:"+sTo+"?subject="+subject+"&amp;body="+body;
  
                 }
  &lt;/script&gt;
  
          &lt;div class="formfields"&gt;Name: &lt;input class="tbox" id="textfieldName" type="text"&gt;
  
           Email: &lt;input class="tbox" id="textfieldEmail" type="text"&gt;
  
  &lt;br&gt;&lt;br&gt;
  
  Message: &lt;input class="tbox" id="textfieldMessage" type="text" style="width: 343px"&gt;
      &lt;/div&gt;
  
  &lt;br&gt;
  
  &lt;input type="button" value="Send!" onclick="SendEmail()" /&gt;
  </code></pre>