Exemple #1
0
 public function setProtocol()
 {
     self::$_protocol = new Zend_Mail_Protocol_Smtp($this->_host, $this->_port, $this->_config);
 }
Exemple #2
0
 public function requestPasswordAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $data = $this->_getParam('data');
     $config = $this->getInvokeArg('bootstrap')->getOption('mail');
     if (isset($config)) {
         if (isset($config["admin"]) && isset($config['host'])) {
             $mail = new Ht_Mail($config['host'], $config['port'] ? $config['port'] : 25);
             //$mail->setCharset('UTF-8');
             $mail->addTo($config["admin"], $config["adminName"]);
             $mail->setFrom($data["email"], $data["name"]);
             $mail->sentMail("Request Password", $data["message"]);
         }
     }
     $this->_dispatcher->notify(new sfEvent($this, 'authentication.log', array('message' => array(sprintf('`%s` request new password.', trim($data["name"]))), 'priority' => Zend_Log::INFO)));
 }
Exemple #3
0
 /**
  * Get system mail instance
  *
  * @return Ht_Mail Mailer include system configuration
  */
 public static function getMailer()
 {
     if (null == self::$_mailer) {
         $config = self::getConfiguration(self::CONFIGURATION_TYPE_MAIL);
         $host = $config->smtp->hostname;
         $port = $config->smtp->config->port;
         $configArr = $config->smtp->config->toArray();
         Zend_Loader::loadClass("Ht_Mail");
         self::$_mailer = Ht_Mail::getInstance($host, $port, $configArr);
     }
     return self::$_mailer;
 }