if (isset($_POST['g-recaptcha-response'])) {
$captcha = $_POST['g-recaptcha-response'];
}
if (!$captcha) {
echo '<script>alert("Lütfen robot olmadığınızı doğrulayın.");</script>';
exit;
}
$kontrol = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=XXXXXXXXXXXXXXX&response=" . $captcha . "&remoteip=" . $_SERVER['REMOTE_ADDR']);
if ($kontrol) {
//MAil gönderme işlemin
}else{
//SPAM GÖNDERİ
}