$to = 'b.karakoulakis@googlemail.com'; $subject = 'Anfrage von No2 Website'; // keys from Google reCaptcha https://www.google.com/recaptcha/admin $sitekey = '6Le6nDcUAAAAAHhhBYXaOA4p1iqgRFrZ-r2JHN4Z'; $secretkey = '6Le6nDcUAAAAAPUdhksreC3v2Nd1iE7ocQW1sV81'; $alert = ''; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $email;$message;$captcha; if(isset($_POST['email'])) $email=$_POST['email']; if(isset($_POST['message'])) $message=$_POST['message']; if(isset($_POST['g-recaptcha-response'])) $captcha=$_POST['g-recaptcha-response']; if(!$captcha) $alert = ''; $response=json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret='.$secretkey.'&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR'])); if($response->success==false) { /* lets set the error message for the alert... */ if ($alert=='') $alert = ''; } else { /* the email to you */ $headers = 'From: '.$to.'' . "\r\n" . 'Reply-To: '.$email.'' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); /* the copy of the email to the *client* */ $headers = 'From: '.$email.'' . "\r\n" . 'Reply-To: '.$to.'' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($email, 'COPY - '. $subject, $message, $headers); /* lets set the success message for the alert... */ $alert = ''; } } ?>