public function contactSendAction()
 {
     if ($_SERVER['REQUEST_METHOD'] == "POST") {
         $json = $this->captchaCheck($_POST);
         // var_dump($json->match);
         if (!$json->match) {
             throw new Exception("Captcha parameters does not match!!", 666);
         }
         $mail = new Pimcore_Mail();
         $mail->addTo($_POST['email']);
         $mail->setBodyText($_POST['comments']);
         $mail->send();
         die;
     }
     throw new Exception("This request method is not supperted here!!", 666);
 }
예제 #2
0
 /**
  * Resends the email to the recipients
  */
 public function resendEmailAction()
 {
     $success = false;
     $emailLog = Document_Email_Log::getById($this->_getParam('id'));
     if ($emailLog instanceof Document_Email_Log) {
         $mail = new Pimcore_Mail('utf-8');
         $mail->preventDebugInformationAppending();
         if ($html = $emailLog->getHtmlLog()) {
             $mail->setBodyHtml($html);
         }
         if ($text = $emailLog->getTextLog()) {
             $mail->setBodyText($text);
         }
         $mail->setFrom($emailLog->getFrom());
         foreach ($emailLog->getToAsArray() as $entry) {
             $mail->addTo($entry['email'], $entry['name']);
         }
         foreach ($emailLog->getCcAsArray() as $entry) {
             $mail->addCc($entry['email'], $entry['name']);
         }
         foreach ($emailLog->getBccAsArray() as $entry) {
             $mail->addBcc($entry['email']);
         }
         $mail->setSubject($emailLog->getSubject());
         $mail->send();
         $success = true;
     }
     $this->_helper->json(array("success" => $success));
 }