title: how can I send form contact to email using javascript?
body: <p>I'm trying to send the data filled in a form to my email:
  form.html:</p>
  
  <pre><code>    &lt;form role="form" name="contact_form"&gt;
    &lt;div class="col-xs-4"&gt;
      &lt;div class="form-group"&gt;
        &lt;input type="text" class="form-control" id="input_name" name="Name" placeholder="Name"&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
        &lt;input type="email" class="form-control" id="input_email" name="Email" placeholder="Email"&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
        &lt;input type="tel" class="form-control" id="input_phone" name="Phone" placeholder="Phone"&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
        &lt;input type="tel" class="form-control" id="input_location" name="Location" placeholder="Location"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="col-xs-6"&gt;
      &lt;div class="form-group"&gt;
        &lt;textarea class="form-control"  id="contact_comment" name="Comment" placeholder="
  
  
  
  Details or comments?" rows="10"&gt;&lt;/textarea&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;div class="col-xs-2"&gt;
      &lt;div class="form-group"&gt;
        &lt;button id="submit_button"type="submit" class="btn btn-primary" onclick="submit_comment()"&gt;Submit&lt;/button&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>script.js:</p>
  
  <pre><code>&lt;script&gt;
  function sendMail(str) {
      var link = "mailto:slim.hmidi1@gmail.com" + "&amp;subject=" + escape("This is my subject") + "&amp;body=" + escape(str);
      location.href = link;
  }
  function submit_comment() {
  var name = document.forms["contact_form"]["Name"].value;
  var Email = document.forms["contact_form"]["Email"].value;
  var Phone = document.forms["contact_form"]["Phone"].value;
  var Location = document.forms["contact_form"]["Location"].value;
  var Comment = document.forms["contact_form"]["Location"].value;
  if((name !="") &amp;&amp; (Email !="") &amp;&amp; (Phone !="") &amp;&amp; (Location !="") &amp;&amp; (Comment !="")) {
     sendMail("HELLO");
  }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I found these </p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/7381150/how-to-send-an-email-from-javascript">how-to-send-an-email-from-javascript</a></li>
  <li><a href="https://stackoverflow.com/questions/271171/sending-emails-with-javascript">sending-emails-with-javascript</a></li>
  </ol>
  
  <p>But it doesn't work for mge.I'm using wordpress to create my own website.How can I fix that?</p>