debugging rsvp-submit.php

This commit is contained in:
spetznas committed 2026-06-17 18:51:18 +02:00
1 parent fdd75e8543
commit 36c25f85d1
1 file changed
+23
+23
View File
@@ -1,4 +1,19 @@
<?php
file_put_contents('/tmp/rsvp-debug.log', "1\n", FILE_APPEND);
require __DIR__ . '/vendor/autoload.php';
file_put_contents('/tmp/rsvp-debug.log', "2\n", FILE_APPEND);
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use Dotenv\Dotenv;
$dotenv = Dotenv::createImmutable(__DIR__ . '/../');
$dotenv->safeLoad();
file_put_contents('/tmp/rsvp-debug.log', "3\n", FILE_APPEND);
require __DIR__ . '/vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
@@ -97,6 +112,7 @@ foreach ($fields as &$field) {
$field = mb_convert_encoding($field, 'UTF-8', 'auto');
}
file_put_contents('/tmp/rsvp-debug.log', "4\n", FILE_APPEND);
$mail = new PHPMailer(true);
try {
@@ -193,7 +209,14 @@ EOD;
$mail->Body = $body;
file_put_contents('/tmp/rsvp-debug.log', "5\n", FILE_APPEND);
$mail->SMTPDebug = 2;
$mail->Debugoutput = 'error_log';
$mail->Timeout = 10;
error_log("About to send mail");
$mail->send();
error_log("Mail sent");
file_put_contents('/tmp/rsvp-debug.log', "6\n", FILE_APPEND);
header('Location: /thank-you/');
exit;