diff --git a/phpgwapi/inc/class.send.inc.php b/phpgwapi/inc/class.send.inc.php index 330d942248..ba31be5ce8 100644 --- a/phpgwapi/inc/class.send.inc.php +++ b/phpgwapi/inc/class.send.inc.php @@ -37,14 +37,18 @@ class send { $this->err["desc"] = " "; } - function msg($service, $to, $subject, $body, $msgtype="", $cc="", $bcc="", $from ="") { + function msg($service, $to, $subject, $body, $msgtype="", $cc="", $bcc="", $from="", $sender='') { global $phpgw_info, $phpgw, $attach_sig; if ($from ==""){ $from = $phpgw_info["user"]["fullname"]." <".$phpgw_info["user"]["preferences"]["email"]["address"].">"; } + if ($sender ==""){ $sender = $phpgw_info["user"]["fullname"]." <".$phpgw_info["user"]["preferences"]["email"]["address"].">"; } if ($service == "email") { $now = getdate(); $header = "Date: " . gmdate("D, d M Y H:i:s") . " +0000\n"; $header .= "From: ".$from."\n"; + if($from != $sender) { + $header .= "Sender: ".$sender."\n"; + } $header .= "Reply-To: ".$phpgw_info["user"]["preferences"]["email"]["address"]."\n"; $header .= "To: $to\n"; if (!empty($cc)) {