Index: trunk/kernel/include/emailmessage.php =================================================================== diff -u -r397 -r437 --- trunk/kernel/include/emailmessage.php (.../emailmessage.php) (revision 397) +++ trunk/kernel/include/emailmessage.php (.../emailmessage.php) (revision 437) @@ -679,7 +679,7 @@ function DeliverMail($To,$From,$Subject,$Msg,$headers, $ForceSend=0) { global $MessagesSent,$objConfig; - + if(($this->MessagesSent >$this->MessagesAtOnce) && !$ForceSend) { $this->EnqueueMail($To,$From,$Subject,$Msg,$headers); @@ -717,15 +717,15 @@ $headers = "Subject: ".trim($Subject)."\r\n".$headers; $send_params['recipients'] = array($To); // The recipients (can be multiple) + $send_params['from'] = $From; // This is used as in the MAIL FROM: cmd $send_params['headers'] = explode("\r\n",$headers); - $send_params['from'] = $From; // This is used as in the MAIL FROM: cmd // It should end up as the Return-Path: header $send_params['body'] = $Msg; // The body of the email $params['host'] = $objConfig->Get("Smtp_Server"); // The smtp server host/ip $params['port'] = 25; // The smtp server port - $params['helo'] = 'INPORTAL'; // What to use when sending the helo command. Typically, your domain/hostname + $params['hello'] = 'INPORTAL'; // What to use when sending the helo command. Typically, your domain/hostname if($objConfig->Get("Smtp_Authenticate")) // Whether to use basic authentication or not { $params['auth'] = TRUE; @@ -745,11 +745,9 @@ } } else - $SmtpServer->debug = 0; + $SmtpServer->debug = 1; $connected = $SmtpServer->connect(); - - if($connected) { if($this->LogLevel>1) @@ -766,6 +764,7 @@ $this->WriteToMailLog($l); } } + if($this->LogLevel>0) { if(count($SmtpServer->errors)>0) @@ -910,21 +909,23 @@ $msg.=$FileContent; $msg .= "--".$OB."\n"; } - + if(strlen($ToName)>0) { $To = "\"$ToName\" <$ToAddr>"; } - else + else { $To = "<".$ToAddr.">"; + } + //$headers.="To: $To\r\n"; if($this->MessagesSent>$this->MessagesAtOnce || $QueueOnly==1) { - $this->EnqueueMail($To,$f,$Subject,$msg,$headers); + $this->EnqueueMail($ToAddr,$From,$Subject,$msg,$headers); } else { - $this->DeliverMail($To,$f,$Subject,$msg,$headers); + $this->DeliverMail($ToAddr,$From,$Subject,$msg,$headers); } }