mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-25 14:51:35 +01:00
* eMail: improving Information on failed send passed on to UI
This commit is contained in:
parent
c3ef252757
commit
ee321972f6
@ -988,7 +988,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;
|
||||
}
|
||||
|
@ -405,7 +405,14 @@ class PHPMailer {
|
||||
* @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 @@ class PHPMailer {
|
||||
* @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 @@ class PHPMailer {
|
||||
* @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 @@ class PHPMailer {
|
||||
* @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 @@ class PHPMailer {
|
||||
*/
|
||||
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);
|
||||
@ -2006,7 +2036,7 @@ class PHPMailer {
|
||||
$msg .= '<p>' . $this->Lang('smtp_error') . $lasterror['smtp_msg'] . "</p>\n";
|
||||
}
|
||||
}
|
||||
$this->ErrorInfo = $msg;
|
||||
$this->ErrorInfo .= (empty($this->ErrorInfo)?'':'<br>').$msg;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user