About a year ago, I had a similar issue except then system would crash after pressing Submit. The issue was caused because of PHP 8 incompatibility problems. However, got the coding to fix all of that and things worked good again and with PHP 8. But now something new is happening. Now, when Submit is pressed, system doesn't crash and goes to the after submission screen like its supposed to. Everything appears to be working fine except for one thing. No emails are being received. Last on line submission form I received was on 2/6/2024. No coding was changed at all, just nothing sends at all. I tested multiple on line submission forms on several websites. Same thing, nothing is sending. The coding I used to fix everything before is the same on all the on-line submission pages. It appears to be an issue with PHP. The coding for 1 of these pages is below.
`
<?php
// grab recaptcha library
// require_once "recaptchalib.php";
// foreach ($_POST as $key => $value) {
//echo '<p><strong>' . $key.':</strong> '.$value.'</p>';
//}
// your secret key
$recaptcha_secret_key = "6LeW4RQUAAAAAJ4NvgWIKJc4b-AeKp6LcLFCFQoS";
// empty response
$recaptcha_response = $_POST['g-recaptcha-response'];
$recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
$recaptcha_data = array(
'secret' => $recaptcha_secret_key,
'response' => $recaptcha_response
);
$recaptcha_options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($recaptcha_data)
)
);
$recaptcha_context = stream_context_create($recaptcha_options);
$recaptcha_result = file_get_contents($recaptcha_url, false, $recaptcha_context);
$recaptcha_json = json_decode($recaptcha_result);
if ($recaptcha_json->success) {
// ReCaptcha validation successful, process the form submission
// Your form processing code goes here
$subject = "Showing Scheduling";
$message = "RadiantNewHorizonHomes.com Showing Scheduling" . "\r\n" . "\r\n" .
"Name: " . $_POST['ShowingName'] . "\r\n" .
"Phone Number : " . $_POST['ShowingPhone1'] . "\r\n" .
"E-mail Address: " . $_POST['ShowingEmail'] . "\r\n" .
"Properties wants to see: " . $_POST['ShowingHomes'] . "\r\n" .
"Date(s)/Time(s) wants to see them: " . $_POST['ShowingTimes'] . "\r\n" .
"Questions or Comments: " . $_POST['ShowingQuestions'] . "\r\n" .
"How Heard About Us: " . $_POST['ShowingHearing'] . "\r\n" .
$from = $_POST['ShowingEmail'];
$headers = "From: $from" . "\r\n";
$to = "david.tigner@radiantnewhorizonhomes.com";
mail($to,$subject,$message,$headers);
$to = "Agents1@radiantnewhorizonhomes.com";
mail($to,$subject,$message,$headers);
} else {
// ReCaptcha validation failed, display an error message or take appropriate action
// Example: redirect back to the form page with an error message
header('Location: form.php?error=recaptcha');
exit();
}
?>
`
`