Mail is not being sent

Please help me, as this was working few days back but now its not working so i am stuck with this issue for nearly a month still i haven’t got the solution.

url:- https://sp-007site.000webhostapp.com/mail.php?to=somesite@edultry.com
the logic to this code is
$to = $_GET[‘to’];

$rno = rand(1000,99999);

$servername=“servername”;
$dbname = ‘dbname’;
$username = ‘username’;
$password = ‘password’;
$conn = new mysqli($servername, $username, $password, $dbname);
$timestamp = date(“Y-m-d H:i:s”);
$subject = “something”;
$message = “Thankyou for registring. \n\n\n”;
$message .= “Please enter this OTP to verify your email address:- $rno”;

$fromemail = “someone@gmail.com”;
$fromname = “something”;
$lt= ‘<’;
$gt= ‘>’;
$sp= ’ ';
$from= ‘From:’;
$headers = $from.$fromname.$sp.$lt.$fromemail.$gt;
if(mail($to,$subject,$message,$headers)){
echo “Sent”;
}
else{
echo “Failed”;
}

and here its showing sent but the mail is not being sent so please help

Hi, PHP mail() is very unreliable on 000webhost. You should try using PHPMailer instead: