save error msg when send mail failed

This commit is contained in:
Uwe Steinmann 2026-01-17 08:49:19 +01:00
parent e6f9b304bf
commit 632ef17c63

View File

@ -54,6 +54,8 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify {
protected $debug;
public $errmsg;
function __construct($dms, $translator, $from_address='', $smtp_server='', $smtp_port='', $smtp_username='', $smtp_password='', $lazy_ssl=true, $force_from=false) { /* {{{ */
$this->_dms = $dms;
$this->_translator = $translator;
@ -65,6 +67,7 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify {
$this->lazy_ssl = $lazy_ssl;
$this->force_from = $force_from;
$this->debug = false;
$this->errmsg = '';
} /* }}} */
public function setDebug($debug=true) { /* {{{ */
@ -251,6 +254,7 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify {
}
$result = $mail->send($to, $hdrs, $message);
if (PEAR::isError($result)) {
$this->errmsg = $result->getMessage();
if($this->debug)
echo "\n".$result->getMessage();
return false;