Example #1
0
 public function __construct($aConfigs = array())
 {
     $this->sName = "Mail";
     $this->sVersion = "1.0";
     $sFileName = $this->getBasePath() . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'swiftmailer' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'swift_required.php';
     if (!file_exists($sFileName)) {
         return false;
     }
     require_once $sFileName;
     parent::__construct($aConfigs);
     $sMethod = isset($this->aConfigs['method']) ? $this->aConfigs['method'] : "mail";
     if ($sMethod == "smtp") {
         $sPort = isset($this->aConfigs['port']) ? $this->aConfigs['port'] : 25;
         $mSecure = isset($this->aConfigs['authenticate']) ? $this->aConfigs['authenticate'] : "tls";
         $sHost = isset($this->aConfigs['host']) ? $this->aConfigs['host'] : "localhost";
         $sUserName = isset($this->aConfigs['user']) ? $this->aConfigs['user'] : "";
         $sPassword = isset($this->aConfigs['password']) ? $this->aConfigs['password'] : "";
         $transport = \Swift_SmtpTransport::newInstance($sHost, $sPort, $mSecure);
         $transport->setUserName($sUserName);
         $transport->setPassword($sPassword);
     } else {
         $transport = \Swift_MailTransport::newInstance();
     }
     $this->oMailer = \Swift_Mailer::newInstance($transport);
 }
Example #2
0
 public function __construct($aConfigs)
 {
     $this->sName = "Android GCM";
     $this->sVersion = "1.0";
     parent::__construct($aConfigs);
     $this->API_ACCESS_KEY = isset($aConfigs['api_access_key']) ? $aConfigs['api_access_key'] : "";
     $this->aOptions = array();
     $this->bIsXMPP = false;
 }