";
$message .= "Email address: " . $email . "
";
$message .= "Message:
";
$message .= $contact_message;
$message .= "
-----
This email was sent from your site's contact form.
";
// Set From: header
$from = $name . " <" . $email . ">";
// Email Headers
$headers = "From: " . $from . "\r\n";
$headers .= "Reply-To: ". $email . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
if (!$error) {
ini_set("sendmail_from", $siteOwnersEmail); // for windows server
$mail = mail($siteOwnersEmail, $subject, $message, $headers);
if ($mail) { echo "OK"; }
else { echo "Something went wrong. Please try again."; }
} # end if - no validation error
else {
$response = (isset($error['name'])) ? $error['name'] . "
\n" : null;
$response .= (isset($error['email'])) ? $error['email'] . "
\n" : null;
$response .= (isset($error['message'])) ? $error['message'] . "
" : null;
echo $response;
} # end if - there was a validation error
}
?>