a friend of mine has a side business and an associated website. the person who always took care of his website is no longer working with him and since he has 0.0 clue about all this, he has turned to me. I've been looking for the problem for 1 1/2 days now and can't find it.
At the bottom of the page is a small form to enter contact information and receive a mail. however, clicking on the "submit" button no longer displays a confirmation, nor does it send a mail via phpmailer. the page is reloaded afterwards, but the input is still there. That captcha seems not to do anything too, because the form has the same behavior with or without the captcha.
This is the script for the mails.
<?php
/**
* Get Template Text
*/
function getTemplateText($text, $center = false) {
$html = '<table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnTextBlock" style="min-width:100%;">';
$html .= '<tr>';
$html .= '<td class="mcnTextContent" style="padding-bottom: 15px;'.($center ? ' text-align:center;' : '').'">'.$text.'</td>';
$html .= '</tr>';
$html .= '</table>';
return $html;
}
$isMailError = false;
if(isset($_POST) && isset($_POST['email'])) {
if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) {
//your site secret key
$secret = 'secret';
//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);
if($responseData->success) {
require_once('../_mailer/class.phpmailer.php');
$mailer = new PHPMailer;
$mailer->IsSMTP(); //per SMTP verschicken
$mailer->Host = SMTP_SERVER; //SMTP-Server
$mailer->SMTPAuth = true; //SMTP mit Authentifizierung benutzen
$mailer->Username = SMTP_USER; //SMTP-Benutzername
$mailer->Password = SMTP_PASSWORD; //SMTP-Passwort
$mailer->CharSet = 'utf-8';
$mailer->FromName = NOREPLY_MAIL_NAME;
$mailer->From = NOREPLY_MAIL;
$mailer->Sender = NOREPLY_MAIL;
//$mailer->WordWrap = 50;
$mailer->IsHTML(true);
$data = array(
'company' => '',
'name' => '',
'email' => '',
'phone' => '',
'message' => '',
'page_uri' => ''
);
foreach($_POST as $i => $v) {
if(isset($data[$i])) {
$data[$i] = $v;
}
}
$data['message'] = nl2br($data['message']);
$mailer->AddAddress(CONTACT_MAIL); //Add a recipient
$mailer->Subject = 'SUBJECT changed';
$msg = '<p>Vielen Dank für Ihre Anfrage, wir werden uns in kürze bei Ihnen melden.</p>';
$msg .= '<p><strong>Ihre Anfrage im Detail:</strong></p>';
$msg .= '<p>';
$msg .= '<strong>Firma:</strong> '.$data['company'].'<br/>';
$msg .= '<strong>Name:</strong> '.$data['name'].'<br/>';
$msg .= '<strong>E-Mail:</strong> '.$data['email'].'<br/>';
$msg .= '<strong>Telefon:</strong> '.$data['phone'].'<br/>';
$msg .= '<strong>Nachricht:</strong><br/>'.$data['message'].'</p>';
$mailer->Body = getTemplateText($msg.'<strong>Seite:</strong> '.$data['page_uri'].'</p>');
$mail_send = $mailer->Send() ? true : false;
$mailer->clearAllRecipients();
$mailer->Body = getTemplateText($msg);
$mailer->Subject = 'subject changed';
$mailer->AddAddress($data['email']); //Add a recipient
$mail_send = $mailer->Send() ? true : false;
$_POST = array();
echo '<div id="anfrage_success"></div>';
} else {
$isMailError = true;
}
} else {
$isMailError = true;
}
}
I just dont know what to do anymore. Has anyone an idea why it seems to stoped working? We did not change anything.
Here are the last error logs I was able to get from the webhosting:
[Thu Sep 22 01:00:23 2022] [ssl:warn] [pid 11739] [client [host AH01909: ****.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Sep 22 16:02:48 2022] [ssl:warn] [pid 11739] [client [host ****: ****:443:0 server certificate does NOT include an ID which matches the server name
[Thu Sep 22 16:04:34 2022] [ssl:warn] [pid 11739] [client [host ****: ****:443:0 server certificate does NOT include an ID which matches the server name
[Thu Sep 22 16:04:59 2022] [ssl:warn] [pid 11739] [client [host ****: ****.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Sep 22 18:06:40 2022] [autoindex:error] [pid 23089] [client ****] [host ****.server-he.de] ****: Cannot serve directory /is/htdocs/****_E1ZMITARW2/www/: No matching DirectoryIndex (index.html,index.htm,index.shtml,index.php,index.php5,index.wml,index.xml) found, and server-generated directory index forbidden by Options directive