Skip to content
Snippets Groups Projects
Commit c5effe4c authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Pb in error management

parent 49d8233e
No related branches found
No related tags found
No related merge requests found
...@@ -321,7 +321,9 @@ class simplemail { ...@@ -321,7 +321,9 @@ class simplemail {
case 'php' : $this->phpmail(); break; case 'php' : $this->phpmail(); break;
case 'socket': $this->socketmailloop(); break; case 'socket': $this->socketmailloop(); break;
} }
return TRUE;
// DOLCHANGE LDR
return (empty($this->error_log)?TRUE:FALSE);
} }
// Mail send by PHPmail // Mail send by PHPmail
...@@ -330,9 +332,10 @@ class simplemail { ...@@ -330,9 +332,10 @@ class simplemail {
while ( list($key, $to) = each($this->recipientlist) ) { while ( list($key, $to) = each($this->recipientlist) ) {
$this->recipient = $to['mail']; $this->recipient = $to['mail'];
if ( mail($to['mail'], $this->subject, $this->body, $this->makeheader() ) ) { if ( mail($to['mail'], $this->subject, $this->body, $this->makeheader() ) ) {
$this->error_log("envoie vers {$to['nameplusmail']} russi"); // DOLCHANGE LDR Comment this to have no error when no error !
//$this->error_log("envoie vers {$to['nameplusmail']} reussi");
} else { } else {
$this->error_log("envoie vers {$to['nameplusmail']} echou"); $this->error_log("envoie vers {$to['nameplusmail']} echoue");
} }
} }
return TRUE; return TRUE;
...@@ -354,7 +357,8 @@ class simplemail { ...@@ -354,7 +357,8 @@ class simplemail {
function SocketSend($in,$wait='') { function SocketSend($in,$wait='') {
fputs($this->connect, $in, strlen($in)); fputs($this->connect, $in, strlen($in));
echo "-"; flush(); //echo $in;
//flush();
if(empty($wait)) { if(empty($wait)) {
$rcv = fgets($this->connect, 1024); $rcv = fgets($this->connect, 1024);
return $rcv; return $rcv;
...@@ -375,7 +379,8 @@ class simplemail { ...@@ -375,7 +379,8 @@ class simplemail {
function socketmailsend($to) { function socketmailsend($to) {
$this->recipient = $to; $this->recipient = $to;
$this->error_log("Socket vers $to"); // DOLCHANGE LDR To have no error when no error
//$this->error_log("Socket vers $to");
$this->SocketSend( "MAIL FROM:{$this->hfrom}\r\n" ); $this->SocketSend( "MAIL FROM:{$this->hfrom}\r\n" );
$this->SocketSend( "RCPT TO:$to\r\n" ); $this->SocketSend( "RCPT TO:$to\r\n" );
...@@ -385,7 +390,8 @@ class simplemail { ...@@ -385,7 +390,8 @@ class simplemail {
$this->SocketSend( ".\r\n" ); $this->SocketSend( ".\r\n" );
$this->SocketSend( "RSET\r\n" ); $this->SocketSend( "RSET\r\n" );
$this->error_log("Fin de l'envoi vers $to"); // DOLCHANGE LDR To have no error when no error
//$this->error_log("Fin de l'envoi vers $to");
return TRUE; return TRUE;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment