mirror of
https://git.code.sf.net/p/seeddms/code
synced 2026-02-02 06:31:56 +00:00
save error msg when send mail failed
This commit is contained in:
parent
e6f9b304bf
commit
632ef17c63
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user