* Change self to static in mailModel.

This commit is contained in:
zhouxin
2023-05-30 10:02:47 +08:00
parent 367ebbafdb
commit 78b295fc61
+2 -2
View File
@@ -169,8 +169,8 @@ class mailModel extends model
{
$mta = $this->config->mail->mta;
$className = ($mta == 'sendcloud' or $mta == 'ztcloud') ? $mta : 'phpmailer';
if(self::$instance == null) self::$instance = new $className(true);
$this->mta = self::$instance;
if(static::$instance == null) static::$instance = new $className(true);
$this->mta = static::$instance;
$this->mta->CharSet = $this->config->charset;
$funcName = "set{$this->config->mail->mta}";
if(!method_exists($this, $funcName)) $this->app->triggerError("The MTA {$this->config->mail->mta} not supported now.", __FILE__, __LINE__, $exit = true);