title: JQuery Ajax Form sends 2 email
body: <p>Anyone knows why I receive 2 emails instead of 1???</p>
  
  <p>I'm really new with JQuery and Ajax, in this code everything is working properly but is sending 2 email each time.</p>
  
  <p>HTML</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form class="well form-horizontal" action=" " method="post" id="contact_form"&gt;
    &lt;fieldset&gt;
  
      ...
  
      &lt;!-- MENSAJE ENVIADO CON EXITO --&gt;
      &lt;div class="alert alert-success" role="alert" id="success_message"&gt;Tu mensaje se ha enviado con exito &lt;i class="glyphicon glyphicon-thumbs-up"&gt;&lt;/i&gt; Gracias por contactar con nosotros, en breve responderemos tu mensaje.&lt;/div&gt;
  
      &lt;!-- BOTON SUBMIT --&gt;
      &lt;div class="form-group"&gt;
        &lt;div class="col-md-12 derecha"&gt;
          &lt;button type="submit" name="submit" class="btn btn-warning"&gt;Enviar &lt;span class="glyphicon glyphicon-send"&gt;&lt;/span&gt;
          &lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
    &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>JAVASCRIPT</p>
  
  <pre class="lang-js prettyprint-override"><code>$(document).ready(function() {
      $('#contact_form').bootstrapValidator({
  
        ...
  
      })
      var form = $('#contact_form'); // contact form
  
      // form submit event
      form.on('submit', function(e) {
  
          e.preventDefault(); // prevent default form submit
  
          $.ajax({
              url: 'enviar.php', // form action url
              type: 'POST', // form submit method get/post
              dataType: 'html', // request type html/json/xml
              data: form.serialize(), // serialize form data 
              success: function(data) {
                  $('#success_message').slideDown({ opacity: "show" }, "slow");
                  $('#contact_form').data('bootstrapValidator').resetForm();
              },
              error: function(e) {
                  console.log(e)
              }
          });
      });
  });
  </code></pre>
  
  <p>AND PHP</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  if (!$_POST){ ?&gt;
      &lt;p&gt;No se ha recibido ningún dato&lt;/p&gt;
      &lt;?php } else {
  
      ...
  
          if (mail($destinatario, $asunto, $cuerpo, $headers)) {
              echo ("ok");
          };
  
      } ?&gt;
  </code></pre>
  
  <p>Thank you in advance!!!</p>