From 0e5530b1397802b21deeba1514934f14ddc42c63 Mon Sep 17 00:00:00 2001 From: Borgal Date: Mon, 2 Feb 2026 12:51:20 +0100 Subject: [PATCH] =?UTF-8?q?v1.4.0=20-=20Mailer=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mail.php | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100755 mail.php diff --git a/mail.php b/mail.php new file mode 100755 index 0000000..a571373 --- /dev/null +++ b/mail.php @@ -0,0 +1,155 @@ +CharSet = 'UTF-8'; + $mail->isSMTP(); + $mail->Host = SMTP_HOST; + $mail->SMTPAuth = true; + $mail->Username = SMTP_USERNAME; + $mail->Password = SMTP_PASSWORD; + $mail->SMTPSecure = SMTP_ENCRYPTION; + $mail->Port = SMTP_PORT; + $mail->setFrom(MAIL_FROM_ADDRESS, MAIL_FROM_NAME); + + $html_body = "

Hallo " . htmlspecialchars($r['username']) . ",

\n

" . nl2br(htmlspecialchars($body)) . "

\n

Dein DoMiLi-Admin

"; + $text_body = "Hallo " . $r['username'] . ",\n\n" . $body . "\n\nDein DoMiLi-Admin"; + + $mail->isHTML(true); + $mail->Subject = $subject; + $mail->Body = $html_body; + $mail->AltBody = $text_body; + $mail->addAddress($r['email']); + $mail->send(); + } catch (Exception $e) { + error_log("Mail-Fehler an {$r['email']}: " . $mail->ErrorInfo); + } + } + $message = "E-Mail wurde an " . count($recipients) . " Empfänger gesendet."; + $message_type = 'success'; + } + } + } + } +} + +$all_users = get_all_users($conn); + +require_once('inc/header.php'); +?> + +
+ + + + +

📧 Nachricht senden

+ +
+
+
+
+ +
+ + +
+
+ +
+ + +
+ +
+
+
+ + +
+
+ + +
+ + Zurück +
+
+
+
+ + + + \ No newline at end of file