title: How to send an email from JavaScript
body: <p>I want my website to have the ability to send an email without refreshing the page. So I want to use Javascript.</p>
  
  <pre><code>&lt;form action="javascript:sendMail();" name="pmForm" id="pmForm" method="post"&gt;
  Enter Friend's Email:
  &lt;input name="pmSubject" id="pmSubject" type="text" maxlength="64" style="width:98%;" /&gt;
  &lt;input name="pmSubmit" type="submit" value="Invite" /&gt;
  </code></pre>
  
  <p>Here is how I want to call the function, but I'm not sure what to put into the javascript function. From the research I've done I found an example that uses the mailto method, but my understanding is that doesn't actually send directly from the site.  </p>
  
  <p>So my question is where can I find what to put inside the JavaScript function to send an email directly from the website.</p>
  
  <pre><code>function sendMail() {
      /* ...code here...    */
  }
  </code></pre>