Skip to content

Commit 6db2774

Browse files
committed
- Added CC and BCC senders to mail function.
- Bugfix: changed "Return-Path: $form" to Return-Path: $from.
1 parent cd27640 commit 6db2774

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

interface/lib/classes/functions.inc.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
class functions {
3535

3636

37-
public function mail($to, $subject, $text, $from, $filepath = '', $filetype = 'application/pdf', $filename = '') {
37+
public function mail($to, $subject, $text, $from, $filepath = '', $filetype = 'application/pdf', $filename = '', $cc = '', $bcc = '') {
3838
global $app,$conf;
3939

4040
if($conf['demo_mode'] == true) $app->error("Mail sending disabled in demo mode.");
@@ -53,7 +53,9 @@ public function mail($to, $subject, $text, $from, $filepath = '', $filetype = 'a
5353
unset($path_parts);
5454
}
5555

56-
$header = "Return-Path: $form\nFrom: $from\nReply-To: $from\n";
56+
$header = "Return-Path: $from\nFrom: $from\nReply-To: $from\n";
57+
if($cc != '') $header .= "Cc: $cc\n";
58+
if($bcc != '') $header .= "Bcc: $bcc\n";
5759
$header .= "MIME-Version: 1.0\n";
5860
$header .= "Content-Type: multipart/mixed; boundary=$uid\n";
5961

@@ -74,6 +76,8 @@ public function mail($to, $subject, $text, $from, $filepath = '', $filetype = 'a
7476
mail($to, $subject, "", $header);
7577
} else {
7678
$header = "From: $from\nReply-To: $from\n";
79+
if($cc != '') $header .= "Cc: $cc\n";
80+
if($bcc != '') $header .= "Bcc: $bcc\n";
7781
$header .= "Content-Type: text/plain;\n\tcharset=\"UTF-8\"\n";
7882
$header .= "Content-Transfer-Encoding: 8bit\n\n";
7983
$subject = "=?utf-8?B?".base64_encode($subject)."?=";

0 commit comments

Comments
 (0)