From e925f79b8f67f330f16ea25f09f1b594eeb4cc4c Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Thu, 3 Sep 2020 11:55:25 +0200 Subject: [PATCH] Add hard-coded recipients --- config.dist.php | 4 ++++ sender.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/config.dist.php b/config.dist.php index 8e05442..8286ecb 100644 --- a/config.dist.php +++ b/config.dist.php @@ -10,6 +10,10 @@ $MAIL_PORT = null; // Default: 587 (no encryption/STARTTLS), 465 (SMTPS) $MAIL_FROM_MAIL = "noreply@expmail.example"; // Leave blank to use $MAIL_USER $MAIL_FROM_NAME = "EXPMail"; +$ALWAYS_TO = []; // List of email addresses that will always be added as "To:" +$ALWAYS_CC = []; // List of email addresses that will always be added as "CC:" +$ALWAYS_BCC = []; // List of email addresses that will always be added as "BCC:" + $API_KEYS = [ "verysecretstring" ]; \ No newline at end of file diff --git a/sender.php b/sender.php index 36de3ec..ff125d4 100644 --- a/sender.php +++ b/sender.php @@ -42,6 +42,10 @@ try { foreach ($json["ccs"] as $cc) $mailer->addCC($cc["email"], $cc["name"]); foreach ($json["bccs"] as $bcc) $mailer->addBCC($bcc["email"], $bcc["name"]); + foreach ($ALWAYS_TO as $recipient) $mailer->addAddress($recipient); + foreach ($ALWAYS_CC as $cc) $mailer->addCC($cc); + foreach ($ALWAYS_BCC as $bcc) $mailer->addBCC($bcc); + $mailer->isHTML((bool) $html); $mailer->Subject = $json["subject"]; $mailer->Body = ($html ? $html : $text);