Attention! You must enter your name.
';
} else if(trim($email) == '') {
$error = 'Attention! Please enter a valid email address.
';
} else if(!isEmail($email)) {
$error = 'Attention! You have enter an invalid e-mail address, try again.
';
}
if(trim($subject) == '') {
$error = 'Attention! Please enter a subject.
';
} else if(trim($comments) == '') {
$error = 'Attention! Please enter your message.
';
} else if(trim($verify) == '') {
$error = 'Attention! Please enter the verification number.
';
} else if(trim($verify) != '4') {
$error = 'Attention! The verification number you entered is incorrect.
';
}
if($error == '') {
if(get_magic_quotes_gpc()) {
$comments = stripslashes($comments);
}
$address = "enquiries@directcoms.co.uk";
$e_subject = 'You\'ve been contacted by ' . $name . '.';
$e_body = "You have been contacted by $name with regards to $subject, their additional message is as follows.\r\n\n";
$e_content = "\"$comments\"\r\n\n";
$e_reply = "You can contact $name via email, $email";
$msg = $e_body . $e_content . $e_reply;
mail($address, $e_subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n");
echo "";
echo "
Email Sent Successfully.
";
echo "
Thank you $name, your message has been submitted to us. We will contact you as soon as we can. Alternatively you can call our Head Office on 01480 466300.
";
echo "
";
}
}
if(!isset($_POST['contactus']) || $error != '')
{
?>