?php include ("includes/config.php"); if(isset($_POST[Submit])) { $email = $_POST[email]; $comments =encodeHtml(strip_tags($_POST[comments])); if(empty($email) && empty($comments) ) { $add_error .="Email Address and Comment should not be blank !"; } elseif(empty($email)) { $add_error .="Email Address should not be blank !"; } elseif(!isEmail($email)) { $add_error .="Email Address is invalid !"; } elseif(empty($comments)) { $add_error .= "Comment should not be blank !"; } if(!$add_error) { $to = $admin_email; $subject = "Request of contact info by: $email"; $MyMessage = "This is an email, sent via $_SERVER[HTTP_HOST] contact us form:"; $MyMessage .= "\n-------------------------------------------------------------------\n"; $MyMessage .= decodeHtml(stripslashes($_POST[email]),view); $MyMessage .= "\n"; $MyMessage .= decodeHtml(stripslashes($_POST[comments]),view); $MyMessage .= "\n-------------------------------------------------------------------\n"; $MyMessage .= "end of the message"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: $email <$email>\r\n"; mail($to, $subject,$MyMessage, $headers); $msg_flag = "
Your message has been sent successfully!"; unset($_POST); } } include("includes/header.html"); include("templates/contactus.html"); include("includes/footer.html"); ?>>