<form action="" method="post">
<input placeholder="Ονομα" name="name" type="text" required />
<input placeholder="Email" name="mail" type="email" required />
<input placeholder="Θεμα" name="subject" type="text" required />
<textarea name="message" placeholder="Μήνυμα"></textarea>
<input class="formBtn" name="submit" type="submit" />
</form>
<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$subject = $_POST['subject'];
$mailfrom = $_POST['mail'];
$message = $_POST['message'];
$mailTo = "myemail";
$headers = "From: ".$mailfrom;
$txt = "You got a new mail from ".$name.".\n\n".$message;
mail($mailTo, $subject, $txt, $headers);
header("Location: form.php?mailsend");
}
?>
myemail is just an example. The original code has my personal email.
So when running this code and filling out the form it reaches to an end(displayes the mailsend message).But when i search through my emails is not there. I tried like 30 times and none of them came to my mailbox Thank you.