We have received your information and will get back to you shortly.
We have received your information and will get back to you shortly.
$mailTo = "your@email.com"; $thisDomain = str_replace("www.", "", $_SERVER['HTTP_HOST']); define('PUBLICKEY', 'your-recaptcha-public-key'); define('PRIVATEKEY', 'your-recaptcha-private-key'); define('DOMAIN', $thisDomain); $myName = $myEmail = $myComment = $error = ""; function stevenferrino_contact_form() { global $post, $mailTo; $isSubmit = isset($_POST['insert']) ? $_POST['insert'] : 0; if ($post->post_name == "contact") { if ($isSubmit) { require("/path/to/your/recaptchalib.php"); foreach ($_POST as $key => $val) { $$key = $val; } # the response from reCAPTCHA $resp = null; # the error code from reCAPTCHA, if any $error = null; # was there a reCAPTCHA response? if ($_POST["recaptcha_response_field"]) { $mail_header = ""; $mail_header .= 'From:' . FROM . '<' . $myEmail . '>' . "\r\n"; $mail_header .= 'Reply-To: <' . $myEmail . '>' . "\r\n"; $mail_header .= 'Return-Path: <' . $mailTo . '>' . "\r\n"; $mail_header .= 'MIME-Version: 1.0' . "\r\n"; $mail_header .= 'Content-Type: text/plain' . "\r\n"; $mail_header .= 'Organization: ' . FROM . "\r\n"; $mail_header .= 'Message-ID: <' . time() . '@' . DOMAIN . '>' . "\r\n"; $mail_header .= 'X-Mailer: PHP v' . phpversion(); $mail_param = "-f$myEmail"; $resp = recaptcha_check_answer (PRIVATEKEY, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if ($resp->is_valid) { $isSubmitted = true; $myComment = stripslashes($myComment); $content = "A website visitor filled out the Contact Us form. Here is the information they provided: Name: $myName Email: $myEmail Subject: $mySubject Comment: $myComment "; mail("$mailTo", "Contact Form Submission", $content, $mail_header, $mail_param); } else { $error = "The human verification failed"; $isSubmit = false; } } } while ( have_posts() ) : the_post(); ?>