added ability to designate Sender: field

This commit is contained in:
skeeter 2001-03-15 05:35:30 +00:00
parent 3c93f4f0e2
commit 7eff94a52d

View File

@ -37,14 +37,18 @@ class send {
$this->err["desc"] = " "; $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; global $phpgw_info, $phpgw, $attach_sig;
if ($from ==""){ $from = $phpgw_info["user"]["fullname"]." <".$phpgw_info["user"]["preferences"]["email"]["address"].">"; } 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") { if ($service == "email") {
$now = getdate(); $now = getdate();
$header = "Date: " . gmdate("D, d M Y H:i:s") . " +0000\n"; $header = "Date: " . gmdate("D, d M Y H:i:s") . " +0000\n";
$header .= "From: ".$from."\n"; $header .= "From: ".$from."\n";
if($from != $sender) {
$header .= "Sender: ".$sender."\n";
}
$header .= "Reply-To: ".$phpgw_info["user"]["preferences"]["email"]["address"]."\n"; $header .= "Reply-To: ".$phpgw_info["user"]["preferences"]["email"]["address"]."\n";
$header .= "To: $to\n"; $header .= "To: $to\n";
if (!empty($cc)) { if (!empty($cc)) {