Пример #1
0
 /**
  * Set MTA.
  * 
  * @access public
  * @return void
  */
 public function setMTA()
 {
     if (self::$instance == null) {
         self::$instance = new phpmailer(true);
     }
     $this->mta = self::$instance;
     $this->mta->CharSet = 'utf-8';
     $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);
     }
     $this->{$funcName}();
 }
Пример #2
0
 /**
  * Set MTA.
  * 
  * @access public
  * @return void
  */
 public function setMTA()
 {
     $className = $this->config->mail->mta == 'sendcloud' ? 'sendcloud' : 'phpmailer';
     if (self::$instance == null) {
         self::$instance = new $className(true);
     }
     $this->mta = self::$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);
     }
     $this->{$funcName}();
     return $this->mta;
 }