PHPMailer multiple sending mail
<p>Im using pop3 php mailler and ajax. There is no problem for sending mail but when I press sent mail button it incease number of mails. So whats the problem</p>

<p>my ajax code :</p>

<pre><code>$("button").click(function(e){
 $('.alert').slideUp(100);
  e.preventDefault();
  var dataArray = $("form").serialize();
  $.ajax({
   type: "POST",
   url: "include/login.php",
   dataType: "json",
   data: dataArray,
   success: function (data) {
    if(data.result == "true"){
     $('.alert').removeClass('alert-danger').addClass('alert-success').slideDown(200);
      $('.alert strong').html("hello "+data.name);
        setTimeout(function(){ 
        window.location.replace("&lt;?php if(isset($_SERVER['HTTP_REFERER'])) { echo "$_SERVER[HTTP_REFERER]";}else{echo "index.php";} ?&gt;"); 
      }, 1200);
     }else if(data.result == "false"){
     $('.alert').removeClass('alert-success').addClass('alert-danger').slideDown(200);
     $('.alert strong').html(data.name);
     }else if(data.result == "warning"){
         $('.alert').removeClass('alert-warning').addClass('alert-danger').slideDown(200);
         $('.alert strong').html(data.name);
         /// send mail button click 
             $('body').on('click','#activation',function(e){
              e.preventDefault();
              $.ajax({
                  beforeSend:function(){
                       $('.alert strong').html("sending mail..");    
                  },
                  url:"include/activation_mail.php",
                  type:"post",
                  data:{u_id:data.userid,u_pass:data.u_pass},
                  success:function(msj){
                     $('.alert').removeClass('alert-danger').addClass('alert-success').slideDown(200);
                     setTimeout(function(){
                     $('.alert strong').html(msj);    
                  },1000);
                 },
                });
              });
             }
            },
          });
      });
</code></pre>

<p>mailing php :</p>

<pre><code>$sql = "UPDATE users SET u_activation_code = '$activation_code' WHERE u_id = '$u_id'";
    $query = mysqli_query($con,$sql);
    if($query){
        $sql="SELECT * FROM users WHERE u_id='$u_id'";
        $query = mysqli_query($con,$sql);
        $row = mysqli_fetch_row($query);
        $id = $row[0];
        $name = $row[1];
        $surname = $row[2];
        $fullname = "$row[1] $row[2]";
        $username = $row[5];
        $email = $row[6];
        $icerik = "aktivasyon maili &lt;a href=''&gt;activation&lt;/a&gt;";

        $mail = new PHPMailer();
        $mail-&gt;CharSet='utf-8';
        $mail-&gt;setFrom('fragman@aktivasyon', 'Aktivasyon');
        $mail-&gt;addReplyTo('mymail@gmail.com', 'activation');
        $mail-&gt;addAddress($email,$fullname);
        $mail-&gt;Subject = 'activation link';
        $mail-&gt;AltBody = 'This is a plain-text message body';
        $mail-&gt;Body = "click active &lt;a href=''&gt;clicked&lt;/a&gt; ";


        //send the message, check for errors
        if (!$mail-&gt;send()) {
            echo "error sending: " . $mail-&gt;ErrorInfo;
        } else {
            echo "send mail";
        }
    }else{
        echo "error query";
    }
</code></pre>

<p>where is problem ?</p>