Optionally CC and BCC all mails
Change-Id: Ic7a4b0c1af6ae3598f925a3b6abb6d7db11f26c7
diff --git a/mail.php b/mail.php
index 9c69255..1432a26 100755
--- a/mail.php
+++ b/mail.php
@@ -4,6 +4,8 @@
include 'config.php';
function send_mail(string $email, object $smtp, object $message) {
+ include 'config.php';
+
$crlf = "\r\n";
$headers = array(
@@ -12,6 +14,15 @@
'Subject' => $message->subject
);
+ if (isset($CC_MAIL)) {
+ $headers['Cc'] = $CC_MAIL;
+ $email .= ', ' . $CC_MAIL;
+ }
+
+ if (isset($BCC_MAIL)) {
+ $email .= ', ' . $BCC_MAIL;
+ }
+
$smtp = Mail::factory('smtp', array(
'host' => $smtp->host,
'port' => $smtp->port,