R33349 - in /trunk: felamimail/inc/class.bocompose.inc.php phpgwapi/inc/class.phpmailer.inc.php

Author: leithoff
New Revision: 33349

URL: http://www.egroupware.org/viewvc/egroupware?rev=33349&view=rev
Log:

  • eMail: improving Information on failed send passed on to UI

Modified:
trunk/felamimail/inc/class.bocompose.inc.php
trunk/phpgwapi/inc/class.phpmailer.inc.php

Modified: trunk/felamimail/inc/class.bocompose.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/trunk/felamimail/inc/class.bocompose.inc.php?rev=33349&r1=33348&r2=33349&view=diff

— trunk/felamimail/inc/class.bocompose.inc.php (original)
+++ trunk/felamimail/inc/class.bocompose.inc.php Thu Dec 9 11:58:04 2010
@@ -997,7 +997,18 @@
$mail->Send();
}
catch(phpmailerException $e) {

  •   			$this->errorInfo = $e->getMessage();
    
  •   			$this->errorInfo = $e->getMessage(); 
    
  •   			if ($mail->ErrorInfo) // use the complete mailer ErrorInfo, for full Information
    
  •   			{
    
  •   				if (stripos($mail->ErrorInfo, $this->errorInfo)===false) 
    
  •   				{
    
  •   					$this->errorInfo = $mail->ErrorInfo.'<br>'.$this->errorInfo;
    
  •   				}
    
  •   				else
    
  •   				{
    
  •   					$this->errorInfo = $mail->ErrorInfo;
    
  •   				}
    
  •   			}
      			error_log(__METHOD__.__LINE__.array2string($this->errorInfo));
      			return false;
      		}
    

Modified: trunk/phpgwapi/inc/class.phpmailer.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/trunk/phpgwapi/inc/class.phpmailer.inc.php?rev=33349&r1=33348&r2=33349&view=diff

— trunk/phpgwapi/inc/class.phpmailer.inc.php (original)
+++ trunk/phpgwapi/inc/class.phpmailer.inc.php Thu Dec 9 11:58:04 2010
@@ -405,7 +405,14 @@
* @return boolean true on success, false if address already used
*/
public function AddAddress($address, $name = ‘’) {

  • return $this->AddAnAddress(‘to’, $address, $name);
  • try
  • {
  •   return $this->AddAnAddress('to', $address, $name);
    
  • } catch (phpmailerException $e)
  • {
  •   //$this->SetError(__METHOD__.__LINE__.$e->getMessage());
    
  •   return false;
    
  • }
    }

/**
@@ -416,7 +423,15 @@
* @return boolean true on success, false if address already used
*/
public function AddCC($address, $name = ‘’) {

  • return $this->AddAnAddress(‘cc’, $address, $name);
  • try

  • {

  •   return $this->AddAnAddress('cc', $address, $name);
    
  • } catch (phpmailerException $e)

  • {

  •   //$this->SetError(__METHOD__.__LINE__.$e->getMessage());
    
  •   return false;
    
  • }

  • }

    /**
    @@ -427,7 +442,14 @@

    • @return boolean true on success, false if address already used
      */
      public function AddBCC($address, $name = ‘’) {
  • return $this->AddAnAddress(‘bcc’, $address, $name);
  • try
  • {
  •   return $this->AddAnAddress('bcc', $address, $name);
    
  • } catch (phpmailerException $e)
  • {
  •   //$this->SetError(__METHOD__.__LINE__.$e->getMessage());
    
  •   return false;
    
  • }
    }

/**
@@ -437,7 +459,14 @@
* @return boolean
*/
public function AddReplyTo($address, $name = ‘’) {

  • return $this->AddAnAddress(‘ReplyTo’, $address, $name);
  • try
  • {
  •   return $this->AddAnAddress('ReplyTo', $address, $name);
    
  • } catch (phpmailerException $e)
  • {
  •   //$this->SetError(__METHOD__.__LINE__.$e->getMessage());
    
  •   return false;
    
  • }
    }

/**
@@ -451,7 +480,8 @@
*/
private function AddAnAddress($kind, $address, $name = ‘’) {
if (!preg_match(’/^(to|cc|bcc|ReplyTo)$/’, $kind)) {

  •  echo 'Invalid recipient array: ' . kind;
    
  • $this->SetError('Invalid recipient type: ' . $kind. ' for Address:'.$address.' '.$name);
    
  •  echo 'Invalid recipient array: ' . $kind;
     return false;
    
    }
    $address = trim($address);
    @@ -2017,7 +2047,7 @@
    $msg .= ‘

    ’ . $this->Lang(‘smtp_error’) . $lasterror[‘smtp_msg’] . “

    \n”;
    }
    }
  • $this->ErrorInfo = $msg;
  • $this->ErrorInfo .= (empty($this->ErrorInfo)?’’:’
    ’).$msg;
    }

/**


This SF Dev2Dev email is sponsored by:

WikiLeaks The End of the Free Internet
http://p.sf.net/sfu/therealnews-com


eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs