Below is my php code for a form I made. It is on my website and seems to work except it isn't forwarding the email to the one I set up in hostgator.
<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$subject = $_POST['subject'];
$mailfrom = $_POST['mail'];
$message = $_POST['message'];
$mailTo = "xavier@xavierbullock.com";
$headers = "From: ".$mailFrom;
$txt = "New form submission from ".$name.".\n\n".$message;
mail($mailTo, $subject, $txt, $headers);
header("Location: contact.html?mailsend");
}
?>
This is part of the error message I received in my hostgator webmail: Messages missing a valid address in From: 550 5.7.1 header, or having no From: header, are not accepted. I am not very familiar with php but I hope this is an easy fix. Thanks in Advance.