3434class 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