邮件发送功能未从.php客户表单调用

I am new to PHP coding. I have created a Customer form, followed by send e-mail function. When a Customer submits data (including E-Mail and password) he should receive a confirmation e-mail with User ID (same as entered E-Mail Id) and entered Password.
At this moment, with my current code, when a Customer submits the form, database gets updated, but no e-mail is send to the user. Can anyone point out what needs to be changed to ensure that send e-mail function works correctly.

<!DOCTYPE html>
<html>
    <head>
        <title>Registration Desk</title>

    </head>
    <body>   
        <div  class="form">
            <form id="contactform" action="reg_submit.php" method="post"> 
                <p class="contact"><label for="name">Name</label></p> 
                <input id="name" name="name" placeholder="First and last name" required=""   tabindex="1" type="text"> 

                <p class="contact"><label for="add">Address</label></p> 
                <textarea id="add" name="add"  style="width:85%; height:60%; margin-top:1%" required=""></textarea> 

                <fieldset>
                    <label>Birthday</label>
                    <input type="date"   name="dob" value="yyyy-mm-dd" required="">
                </fieldset>



                <label>I am</label>&nbsp;&nbsp;&nbsp;&nbsp;<br><br>


                <input type="radio" name="sex" value="male" >Male &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                <input type="radio" name="sex" value="female">Female




                <p class="contact"><label for="email">Email</label></p> 
                <input id="email" name="email" class="field" placeholder="Please enter a valid emailid" required="" type="email">


                <p class="contact"><label for="password">Create a password</label></p> 
                <input type="password" id="password" name="password" required=""> 
                <p class="contact"><label for="repassword">Confirm your password</label></p> 
                <input type="password" id="repassword" name="repassword" required=""> 


                <br><br>

                <p class="contact"><label for="phone">Mobile phone</label></p> 
                <input id="phone" name="phone" placeholder="phone number" required="" type="text"> <br>
                <input class="buttom" name="submit" id="submit" tabindex="5" value="Sign me up!" type="submit">      
            </form> 
        </div>      
        </div>

    </body>
</html>
<?php
error_reporting( 0);
$connect=mysqli_connect("localhost","wbtecqoj_saltee","webuildtec1","wbtecqoj_salteegroup");
if(mysqli_connect_errno())
{
    echo "Failed to connect to MySQL: " . mysqli_connect_error();   
}


if( $_POST["password"]!= $_POST["repassword"])
{
?>
    <script type="text/javascript">
    alert("password miss matched!!!.");
    history.back();


    </script>

<?php

}
if($_POST["name"]  &&  $_POST["add"]  &&  $_POST["phone"] &&  $_POST["email"] &&  $_POST["password"] &&  $_POST["dob"]  ) 
{
    $insert="INSERT INTO `db`.`new_user` (`id`, `name`, `add`, `contact`, `email`, `pass`, `dob`, `gender`,`code`) VALUES (NULL, '$_POST[name]', '$_POST[add]', '$_POST[phone]', '$_POST[email]', '$_POST[password]',  '$_POST[dob]', '$_POST[sex]', 'SAL1000000')";

    if(!mysqli_query($connect,$insert))
    {
        echo die('Error: ' . mysqli_error($connect));
    }
    else
    {

        $to=$_POST['email'];
        $from= "admin@wbtec.in";
        $subject="Welcome to xyz Group";


        $message="Welcome " . $_POST['name'] . "Dear Customer,
Your  Card Number is    " .$Ccode.$cookieId. " User id -" . $_POST['email'] . "Your Password -" . $_POST['password']. 
"Thanking You,
Customer Care,";
        $header = "From" .$from;

        if(isset($_POST['btnSend']))
        {
            $res = mail($to,$subject,$message,$header);
            if($res)
            {
                echo 'Message send';
            }
            else
            {
                echo 'msg not send';
            }
        }

}}
mysqli_close($connect);
?>

You are checking for

if(isset($_POST['btnSend']))

But your form doesn't contain an input named btnSend, you should be able to remove that if statement altogether

Remove the

   if(isset($_POST['btnSend']))
    {
}

u have to download php mailer library which have to files PHP mailer

class.phpmailer.php and other class.smtp.php then add this file at same directory which have php code which is shown below..

<?PHP
require_once('class.phpmailer.php');

if('POST' == $_SERVER['REQUEST_METHOD']) {
        // process the form here

    $subject = "This is subject testing1";
    $mail = new PHPMailer();    
    $mail->IsSMTP();
    $mail->IsHTML(true); // send as HTML    
    $mail->SMTPAuth   = true;                  // enable SMTP authentication
    $mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
    $mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
    $mail->Port       = 465;                   // set the SMTP port 
    //$mail->Username   = "gmailusername";                    // GMAIL username
    //$mail->Password   = "password";                                           // GMAIL password   
    $mail->From       = 'email id';
    $mail->FromName   = "FrontName";
    $mail->Subject    = $subject;
    $mail->Body       = "this is html body";           //HTML Body
    $emailId='email id';
    $emails  = explode(",",$emailId);
    foreach($emails as $email)
           $mail->AddAddress($email);

    if($mail->Send()){
        echo "Message sent successfully";
    }else{
        echo "Mailer Error: " . $mail->ErrorInfo;
    }
}
    ?>
<form action="" method="post">
  <input type="submit" name='button1'value="sent mail" />
</form>

I suggest you to use PHPMailer from http://sourceforge.net/projects/phpmailer/

With the PHPMailer class you can specify the outgoing SMTP server and authenticate with it properly. Here is an example how I used it:

<?php
require("class.phpmailer.php");

class Mailer
{
    function send($email, $subject, $body, $attachment1)
    {
        $mail = new PHPMailer();

        $mail->IsSMTP();                                   // send via SMTP
        $mail->Host     = "mail.xyz.com"; // your SMTP servers
        $mail->SMTPAuth = true;     // turn on SMTP authentication
        $mail->Username = "authname";  // SMTP username
        $mail->Password = "authpassword"; // SMTP password

        $mail->From     = "info@xyz.com";
        $mail->FromName = "info@xyz.com";
        $mail->AddAddress($email); 

        $mail->WordWrap = 50;                              // set word wrap
        if ($attachment1 != "") {
            $mail->AddAttachment($attachment1);      // attachment1
        }
        $mail->IsHTML(false);                               // send as HTML

        $mail->Subject  =  $subject;
        $mail->Body     =  $body;

        if(!$mail->Send())
        {
            return -1;
        }
        else
        {
            return 0;
        }
    }
}
?>

Hope that helps!