ftimme
2012-06-11 6db27748d01ef709bf61a35314a56c565545bb7f
- Added CC and BCC senders to mail function.
- Bugfix: changed "Return-Path: $form" to Return-Path: $from.
1 files modified
8 ■■■■ changed files
interface/lib/classes/functions.inc.php 8 ●●●● patch | view | raw | blame | history
interface/lib/classes/functions.inc.php
@@ -34,7 +34,7 @@
class functions {
    
    public function mail($to, $subject, $text, $from, $filepath = '', $filetype = 'application/pdf', $filename = '') {
    public function mail($to, $subject, $text, $from, $filepath = '', $filetype = 'application/pdf', $filename = '', $cc = '', $bcc = '') {
        global $app,$conf;
        
        if($conf['demo_mode'] == true) $app->error("Mail sending disabled in demo mode.");
@@ -53,7 +53,9 @@
                unset($path_parts);
            }
            $header = "Return-Path: $form\nFrom: $from\nReply-To: $from\n";
            $header = "Return-Path: $from\nFrom: $from\nReply-To: $from\n";
            if($cc != '') $header .= "Cc: $cc\n";
            if($bcc != '') $header .= "Bcc: $bcc\n";
            $header .= "MIME-Version: 1.0\n";
            $header .= "Content-Type: multipart/mixed; boundary=$uid\n";
@@ -74,6 +76,8 @@
            mail($to, $subject, "", $header);
        } else {
            $header = "From: $from\nReply-To: $from\n";
            if($cc != '') $header .= "Cc: $cc\n";
            if($bcc != '') $header .= "Bcc: $bcc\n";
            $header .= "Content-Type: text/plain;\n\tcharset=\"UTF-8\"\n";
            $header .= "Content-Transfer-Encoding: 8bit\n\n";
            $subject      = "=?utf-8?B?".base64_encode($subject)."?=";