From 7e7e473279ed6ac5b8f077890c58116d982063ac Mon Sep 17 00:00:00 2001 From: spetznas Date: Sat, 16 May 2026 22:55:44 +0200 Subject: [PATCH] Reverted to old rsvp-submit.php --- static/rsvp-submit.php | 57 +++++++----------------------------------- 1 file changed, 9 insertions(+), 48 deletions(-) diff --git a/static/rsvp-submit.php b/static/rsvp-submit.php index 4ce9b79..fd83e9e 100755 --- a/static/rsvp-submit.php +++ b/static/rsvp-submit.php @@ -9,17 +9,6 @@ if (!empty($_POST['website'])) { exit; // silently drop bot submission } -/* Load environment variables (your Option 1) */ -$env = parse_ini_file('/etc/wedding.env'); - -$smtpUser = $env['SMTP_USER'] ?? null; -$smtpPass = $env['SMTP_PASS'] ?? null; -$smtpHost = $env['SMTP_HOST'] ?? 'posteo.de'; - -if (!$smtpUser || !$smtpPass) { - exit("Server misconfiguration (missing SMTP credentials)"); -} - /* Safely read form fields */ $first_name = htmlspecialchars($_POST['first_name'] ?? ''); $last_name = htmlspecialchars($_POST['last_name'] ?? ''); @@ -31,47 +20,19 @@ if (!$first_name || !$last_name) { exit("Missing required fields"); } -/* Build email content */ +/* Email setup */ $to = "hochzeit@markinstefan.xyz"; $subject = "New Wedding RSVP from $first_name $last_name"; -$body = "New RSVP received:\n\n"; -$body .= "Name: $first_name $last_name\n"; -$body .= "Drinks: $drinks\n"; -$body .= "Allergies: $allergies\n"; -$body .= "Time: " . date("Y-m-d H:i:s") . "\n"; +$message = "Name: $first_name $last_name\n"; +$message .= "Drinks: $drinks\n"; +$message .= "Allergies: $allergies\n"; -/* Load PHPMailer */ -use PHPMailer\PHPMailer\PHPMailer; -use PHPMailer\PHPMailer\Exception; +$headers = "From: no-reply@markinstefan.xyz\r\n"; +$headers .= "Reply-To: no-reply@markinstefan.xyz\r\n"; -require __DIR__ . '/vendor/autoload.php'; +/* Send mail */ +mail($to, $subject, $message, $headers); -$mail = new PHPMailer(true); - -try { - /* SMTP config */ - $mail->isSMTP(); - $mail->Host = $smtpHost; - $mail->SMTPAuth = true; - $mail->Username = $smtpUser; - $mail->Password = $smtpPass; - $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; - $mail->Port = 587; - - /* Email headers */ - $mail->setFrom($smtpUser, 'Wedding RSVP'); - $mail->addAddress($to); - - $mail->Subject = $subject; - $mail->Body = $body; - - $mail->send(); - - echo "Thank you! Your RSVP has been sent."; - -} catch (Exception $e) { - error_log("RSVP mail failed: " . $mail->ErrorInfo); - exit("Sorry, something went wrong sending your RSVP."); -} +echo "Thank you! Your RSVP has been sent."; ?>