Change the code to
if(isset($_POST['submit'])) {
$msg = 'Name: ' .$_POST['FirstName'] .$_POST['LastName'] ."\n"
.'Email: ' .$_POST['Email'] ."\n"
.'Message: ' .$_POST['Message'];
mail('[email protected]', 'Message from website', $msg);
header('location: contact-thank-you.php');
}
else {
header('location: contact.php');
exit(0);
}
You need to have {
and }
instead of (
& )
1
solved php syntax errors on simple sendmail code [closed]