128) missing_field("name"); $email = $_POST["email"] ?? missing_field("email"); if (empty($email) || strlen($email) > 128 || !str_contains($email, "@")) missing_field("email"); $subject = $_POST["subject"] ?? missing_field("subject"); if (empty($email) || strlen($subject) > 256) missing_field("subject"); $message = $_POST["message"] ?? missing_field("message"); if (empty($email) || strlen($message) > 16384) missing_field("message"); $captcha = $_POST["captcha"] ?? missing_field("captcha"); if (empty($email) || strlen($captcha) > 7) missing_field("captcha"); $expected_captcha = $_SESSION["captcha_phrase"] ?? null; if ($captcha !== $expected_captcha) { http_response_code(400); echo "Ungültiges CAPTCHA!"; exit; } require_once __DIR__ . "/../vendor/autoload.php"; $mailer_dsn = getenv_or_fail("MAILER_DSN"); $transport = Transport::fromDsn($mailer_dsn); $transport->send((new Email()) ->from(new Address("mystic-contactform+no-reply@jonaskohl.de", $name)) ->to("mystic@jonaskohl.de") ->replyTo(new Address($email, $name)) ->subject("[Mystic House Corner] $subject") ->text($message) ); header("Location: /pages/sent.html");