title: Recive 2 emails, and dont know why
body: <p>I inherited code, and now I have problem which I can not detected. When I fill up my form I receive 2 emails instead of 1. So if someone can help me and tell me why. 
  My code is here: 
  HTML: </p>
  
  <pre><code>&lt;div class="container text-center forma-kontakt"&gt;
  
  &lt;form class="form-inline" id="upitForma" method="POST"&gt;
      &lt;div class="form-group xx"&gt;
          &lt;label class="sr-only" for="email2"&gt;Ime:&lt;/label&gt;
          &lt;input type="email2" class="form-control" id="upitIme" placeholder="Unesite Vase ime"&gt;
          &lt;br&gt;
          &lt;br&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;label class="sr-only" for="ime2"&gt;Email:&lt;/label&gt;
          &lt;input type="text" class="form-control" id="upitEmail" placeholder="Unesite Vas email"&gt;
          &lt;br&gt;
          &lt;br&gt;
      &lt;/div&gt;
      &lt;br&gt;
      &lt;div class="form-group"&gt;
          &lt;label class="sr-only" for="ime2"&gt;Adresa Vašeg web-sajta:&lt;/label&gt;
          &lt;input type="text" class="form-control" id="upitSajt" placeholder="Vaš web-sajt (opciono):"&gt;
          &lt;br&gt;
          &lt;br&gt;
      &lt;/div&gt;
  
  
      &lt;div class="form-group text-center" style="display:block"&gt;
          &lt;label for="message" class="col-sm-12 control-label text-center"&gt;Poruka&lt;/label&gt;
          &lt;div class="col-sm-12"&gt;
              &lt;textarea class="form-control" rows="4" name="message2" style="height:260px; width:600px"
                        id="upitMsg"&gt;&lt;/textarea&gt;
              &lt;br&gt;
              &lt;br&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  
      &lt;input type="submit" id="upitBtn" class="btn btn-primary center-block" style="margin-top:20px; width:100px" value="Pošalji poruku"&gt;
      &lt;/input&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>PHP: </p>
  
  <pre><code>&lt;?php
  class Upit extends Controller {
  public function index() {
      $this-&gt;view("upit/index", []);
  }
  public function upit() {
      if (isset($_POST['ime']) &amp; isset($_POST['eMail']) &amp; isset($_POST['poruka'])) {
          $ime = $_POST['ime'];
          $mail = $_POST['eMail'];
          $poruka = $_POST['poruka'];
      } else
          return 0;
      if (isset($_POST['listaUsluga']))
          $listaUsluga = $_POST['listaUsluga'];
      else
          $listaUsluga = '';
      if (isset($_POST['sajt']))
          $sajt = $_POST['sajt'];
      else
          $sajt = '';
      echo 1;
  
      $to      = 'example@mail.com';
      $subject = 'Upit kontakt';
      $message = "Novi kontakt od osobe: $ime (eMail: $mail ) \r\nPoruka glasi: \r\n $poruka \r\n\r\n Selektovana lista usluga: $listaUsluga\r\n\r\n $sajt\r\n\r\n !!! Ovo je automatska poruka, ne odgovarati na dugme REPLAY !!!";
      //$headers = 'From: example@mail.com' . "\r\n" .
          //'Reply-To: From: example@mail.com' . "\r\n" .
          //'X-Mailer: PHP/' . phpversion();
  
      mail($to, $subject, $message, $header);
  
  }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>JS: </p>
  
  <pre><code> $('#upitBtn').on("click", function(e) {
      e.preventDefault();
      var myForm = $('#dugme');
      var anyBoxChecked = false;
      var i;
      var txt = "";
      var ime = $('#upitIme').val();
      var eMail = $('#upitEmail').val();
      var poruka = $('#upitMsg').val();
      var sajt = $('#upitSajt').val();
      $('#dugme input:checked').each(function(e) {
          //if($(this).is(":checked")) {
              anyBoxChecked = true;
              txt += " " + $(this).val();
          //}
      });
  
      var $myForm = $('#upitForma');
      if (!$myForm[0].checkValidity())
          $myForm.find(':submit').click();
      else
          e.preventDefault();
      var eMail = $('#upitEmail').val().trim();
      /*alert(eMail);
      alert(txt);
      alert(ime);
      alert(poruka);*/
      $.ajax({
          async:false,
          type: "POST",
          url: "/upit/upit/",
          dataType: 'text',
          //data: {eMail:eMail, listaUsluga:txt, ime:ime, poruka:poruka, sajt:sajt}, 
          cache: false
      })
      .done(function(rez) {
          if (rez=="0") {
              $('#upitEmail').css({ "border": '#FF0000 1px solid'});
              $('#upitEmail').val('');
              $('#upitEmail').attr("placeholder", "Unesite ispravan mail!");
          } else {
              $('#upitEmail').val('');//TODO obrisati values i svih ostalih polja
              $('#modalBoxUspehUpit').trigger("click");
          }
      })
      .fail(function (xhr, ajaxOptions, thrownError) {
          console.log(xhr);
          console.log(ajaxOptions);
          console.log(thrownError);            
      });
      return false;
  });
  </code></pre>
  
  <p>I don't know is this properly question, but I am stuck and don't know where is mistake. So all advice and suggestions are welcome. </p>