예제 #1
0
 public function runModule($args)
 {
     $require = array('waitting_for' => NULL);
     $getArgs = $this->initArgs($args, $require);
     if ($getArgs['waitting_for'] && isset($this->stack[$getArgs['waitting_for']]['mailer'])) {
         $phpmailer = new Phpmailer();
         $userModel = $this->loadModel('users');
         $webMaster = $userModel->fetchOneByKey(1);
         $phpmailer->isSMTP();
         $phpmailer->SMTPDebug = __DEBUG__;
         $phpmailer->CharSet = $this->stack['static_var']['charset'];
         $phpmailer->Encoding = 'base64';
         $phpmailer->From = $webMaster['user_mail'];
         $phpmailer->FromName = $webMaster['user_name'];
         $phpmailer->Host = $this->stack['static_var']['smtp_host'];
         $phpmailer->Port = $this->stack['static_var']['smtp_port'];
         $phpmailer->SMTPAuth = $this->stack['static_var']['smtp_auth'];
         $phpmailer->IsHTML(false);
         $phpmailer->IsSSL($this->stack['static_var']['smtp_ssl']);
         $phpmailer->Username = $this->stack['static_var']['smtp_user'];
         $phpmailer->Password = $this->stack['static_var']['smtp_pass'];
         $phpmailer->AddAddress($this->stack[$getArgs['waitting_for']]['mailer']['send_to'], $this->stack[$getArgs['waitting_for']]['mailer']['send_to_user']);
         if (isset($this->stack[$getArgs['waitting_for']]['mailer']['reply']) && $this->stack[$getArgs['waitting_for']]['mailer']['reply']) {
             $phpmailer->AddReplyTo($this->stack[$getArgs['waitting_for']]['mailer']['reply'][1], $this->stack[$getArgs['waitting_for']]['mailer']['reply'][0]);
         }
         $phpmailer->WordWrap = 50;
         $phpmailer->Subject = $this->stack[$getArgs['waitting_for']]['mailer']['subject'];
         $phpmailer->Body = $this->stack[$getArgs['waitting_for']]['mailer']['body'];
         $phpmailer->Send();
     }
 }
예제 #2
0
 public function executeTeste(Content &$objContent)
 {
     $objContent->getObjTemplate()->setLayout('Red');
     $objEmail = new Phpmailer();
     $body = "Olá mundo.";
     //$objEmail->IsSendmail();
     $objEmail->MsgHTML("Ola Mundo");
     $objEmail->AddAddress("*****@*****.**");
     $objEmail->SetFrom("*****@*****.**");
     $objEmail->Subject = "OKOKO";
     if (!$objEmail->Send()) {
         $log = new Log();
         $log->setLog(__FILE__, "Mailer Error: " . $objEmail->ErrorInfo);
         $this->var2 = "Mailer Error: " . $objEmail->ErrorInfo;
     }
     $this->var1 = $this->getRequestParameter('número') * 20;
     $this->var2 = "Success!!";
     $this->forward1 = $this->getRequestParameter('número');
     $this->forward2 = $this->getRequestParameter('oba');
     $this->link = Headers::linkTo('Default', 'Index', array('culture' => $objContent->getObjCulture()->getCulture()));
     var_dump(Headers::linkToCss('Default', 'estilos.css'));
 }