Would like to send email to the person who filled out the form and one to the admin of the website to respond back to the client. The code sends properly to the person who filled the form, but nothing to the admin. See code below.
<?php
$EmailFrom = "jason@mysite.com";
$EmailTo = stripslashes($_POST['email']);
$Subject = stripslashes($_POST['subject']);
$Name = Trim(stripslashes($_POST['author']));
$Email = Trim(stripslashes($_POST['email']));
$Message = Trim(stripslashes($_POST['message']));
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = '';
$Body .= "Thank you for contacting us! One of our staff will contact you soon.";
$Body .= "\n";
$Body .= "\n";
$Body .= "";
$Body .= "\n";
$Body .= "\n";
$Body .= "----------------------------";
$Body .= "\n";
$Body .= "Subject: ";
$Body .= $Subject;
$Body .= "\n";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";
ini_set($EmailFrom, $EmailTo);
// send email
$success = mail($EmailTo, $Subject, $Body, 'From: ' . $EmailFrom);
// redirect to success page
if ($success){
echo "Thank you for contacting us!";
}
else{
echo "Please Try Again.";
}
?>