I have been working on a webform which is new to me. When testing it I discovered the host company required 2 email addresses (normal one and root) in order to validate. So I had to add the code they suggested to the sendmail.php file as seen below.
Will this validate and if not what would be the correct code in order for these problems to be corrected? Thanks.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
mail("service@site.com", "Register Interest Form Results", $_REQUEST[message], "From: $_REQUEST[email]", "-froot@site.com".$_REQUEST[email]);
$MESSAGE_BODY = "Name: ".$_POST["name"]." ";
$MESSAGE_BODY .= "Email: ".$_POST["email"]." ";
$MESSAGE_BODY .= "Phone: ".$_POST["phone"]." ";
$MESSAGE_BODY .= "Company: ".$_POST["company"]." ";
$MESSAGE_BODY .= "Jobtitle: ".$_POST["jobtitle"]." ";
$MESSAGE_BODY .= "Besttime2call: ".$_POST["besttime2call"]." ";
$MESSAGE_BODY .= "Howdidyouhear: ".$_POST["howdidyouhear"]." ";
$boxes = '';
if (isset($_POST['boxes']) && is_array($_POST['boxes']))
$boxes = implode(', ', $_POST['boxes']);
$MESSAGE_BODY .= "Options: ".$boxes;
$MESSAGE_BODY .= "Comment: ".nl2br($_POST["comment"])." ";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY) or die ("Failure");
header( "Location: http://www.site.com/thankyou.html" );
?>
</body>
</html>