can anyone please help me with my code, I try to send email with form submission I don't get any error but also no mail recive this is my code
<?php
if (isset($_POST['submit'])) {
$to = "my.email@gmail.com";
$from=$_POST['email'];
$first_name=$_POST['first_name'];
$last_name=$_POST['last_name'];
$subject="Form submission";
$message=$first_name." ".$last_name." wrote the following:"."\n\n".$_POST['message'];
$headers="From:".$from;
mail($to,$subject,$message,$headers);
echo "Mail Sent. Thank you ".$first_name." we will contact you shortly.";
header("Location: ../pages/home.html"); /* Redirect browser */
exit();
}
?>
and this is my form
<form id="formContact" action="../php/email.php" method="post">
<fieldset>
Nume:<br>
<input id="firstname" type="text" name="first_name" required >
<br>
Prenume:<br>
<input id="lastname" type="text" name="last_name" required >
<br>
Email:<br>
<input id="email" type="email" name="email" required >
<br>
Mesaj:<br>
<textarea id="mesage" name="message" required>
</textarea>
<br>
<br>
<input id="buttonOK" type="submit" value="OK" name="submit">
</fieldset>
</form>