I need to confirm user registration with entered email address but i am unable to send mail now the code worked 2 weeks ago but now it is not working I can't understand what is wrong in my code maybe it stopped working because of php update or there is other reason?
$mail = trim(htmlspecialchars($conn->real_escape_string($_POST["mail"])));
$subject = "FULLBX.COM";
$message = '<h3>Account activation code: </h4> <h2 style="color:#ec5f06;">' . $tempCode . '</h3>';
$header = "From:support@fullbx.com \r\n";
$header .= "Cc:support@fullbx.com \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";
$mailsent = mail($mail,$subject,$message,$header);
if (($mailsent)) {
$_SESSION["tempcode"] = $tempCode;
$_SESSION["username"] = $username;
$_SESSION["mail"] = $mail;
$_SESSION["phone"] = $phone;
$_SESSION["pass"] = $pass;
}else{
echo "email is not sending please try again";
exit();
}
I always get "email is not sending please try again" error message