Help with contact form

Hi,
I have a very basic cont form which only works when using Firfox.
I have tested it with Chrome, Safari and Android but I don’t receive an email from any of these. Not sure what’s going on here.

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$call = $_POST['call'];
$type = $_POST['type'];
$message = $_POST['message'];
$formcontent=" From: $name \n 
Phone: $phone \n 
Type: $type \n 
Message: $message";
$recipient = "[email protected]";
$subject = "Book_a_Course Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Your message has been sent successfully.  Thank You!" . " -" . "<a href='https://nobullab.com.au/' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
?>

Help …

Unless there’s an error in the form markup, which you didn’t post, there’s nothing that is browser dependent in the posted code.

The only apparent related problem in the posted code is that these emails are not being sent from the email address that was entered in the form. They are being sent from the mail server at your web hosting and the domain in the From: mail header must correspond to the domain at the sending mail server, either directly or through DNS records at the sending mail server. You can put the email address that was entered in the form into a Reply-to: mail header, after you have validated that it is only and exactly one properly formatted email address, to prevent mail header injection.

You also need to apply htmlentities() to all the dynamic values, after trimming and validating them, to help prevent cross site scripting if the emails are being viewed using a browser.

Sponsor our Newsletter | Privacy Policy | Terms of Service