include_once ("inc_validateEmail.php");
function validateForm ()
{
$msg = "";
$fName = $_POST['fName'];
$fEmail = $_POST['fEmail'];
$fSubject = $_POST['fSubject'];
$fBody = $_POST['fBody'];
$to = "sshivaya@earthlink.net,lindatyler@earthlink.net"; //"blackfly@blackflydesign.com" "rhproductions@earthlink.net"
//$to = "captain_james_canuck@yahoo.com";
if (empty ($fName)) $msg = "Please enter a valid name.";
else if (empty ($fSubject)) $msg = "Please specify a subject.";
else if (empty ($fBody)) $msg = "You forgot to type your message!";
else $msg = validateEmailStrong ('dummy', $to, $fName, $fEmail, $fSubject);
// Was the form free of errors?
echo '';
if ($msg == 'okay')
{
echo "";
echo "Sending your email ...
";
$basicHeaders = "From: $fName <$fEmail>";
$subject = "RH contact: $fSubject";
$body = stripslashes ($fBody);
function sendMail ($to, $subject, $message, $basicHeaders)
{
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: php\n";
$headers .= $basicHeaders . "\n";
return (mail ($to, $subject, $message, $headers));
}
if (@sendMail ($to, $subject, $body, $basicHeaders))
{
$returnString = 'Email sent — thank you!';
} else {
$returnString = 'Oops — there was a problem with the server; please try again a little later.
Sorry for the incovenience!';
}
echo $returnString;
}
else
{
echo "
$msg
";
}
echo '
';
}
?>