I'm trying to make a contact form in HTML page. I've linked it with a .php file and but both on a server but I don't receive any email. Someone can see my mistake?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contact form tutorial</title>
</head>
<body>
<main>
<p>SEND EMAIL</p>
<form action="contactform.php" method="post">
<input type="text" name="name" placeholder="Full name">
<input type="text" name="mail" placeholder="Your e-mail">
<input type="text" name="subject" placeholder="subject">
<textarea name="message" placeholder="Message"></textarea>
<button type="submit" name="submit">SEND MAIL</button>
</form>
</main>
</body>
</html>
<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$subject = $_POST['subject'];
$mailFrom = $_POST['mail'];
$message = $_POST['message'];
$mailTo = "MINE@EMAIL.COM";
$headers = "From: ".$mailFrom;
$txt = "You have received an e-mail from ".$name.".\n\n" . $message;
mail($mailTo, $subject, $txt, $headers);
header("Location: index.php?mailsend"); }