Merhaba Arkadaşlar Captcha Sorunu Sayenizde Çözdüm Bu Seferde Mail Gönderilmiyor Gmail İle Mail Göndermeyi İstiyorum Hatamı Düzeltirseniz Sevinirim :

if(isset($_POST['submit'])):
if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])):
//your site secret key
$secret = 'InsertSiteSecretKey';
//get verify response data
$verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
$responseData = json_decode($verifyResponse);

$name = !empty($_POST['name'])?$_POST['name']:'';
$email = !empty($_POST['email'])?$_POST['email']:'';
$message = !empty($_POST['message'])?$_POST['message']:'';
if($responseData->success):
//contact form submission code
$to = 'codexworld@gmail.com';
$subject = 'New contact form have been submitted';
$htmlContent = "

Contact request details


Name: ".$name."


Email: ".$email."


Message: ".$message."


";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From:'.$name.' <'.$email.'>' . "\r\n";
//send email
@mail($to,$subject,$htmlContent,$headers);

$succMsg = 'Your contact request have submitted successfully.';
$name = '';
$email = '';
$message = '';
else:
$errMsg = 'Robot verification failed, please try again.';
endif;
else:
$errMsg = 'Please click on the reCAPTCHA box.';
endif;
else:
$errMsg = '';
$succMsg = '';
$name = '';
$email = '';
$message = '';
endif;
?>


Using new Google reCAPTCHA with PHP by CodexWorld
<script></script>




Contact Form