getLangCode()); if(is_file(TEMPLATES_DIR.TEMPLATE."/contactsForm.php")){ ob_start(); include(TEMPLATES_DIR.TEMPLATE."/contactsForm.php"); $html = ob_get_clean(); }else{ $html = "error loading html"; } $fc->setBody($html); } public function mail(){ $this->fillFromPost($_POST); $this->sendMail(); header("location:".$_SESSION["url"]."/mail/sent"); } public function fillFromPost($rs){ $this->name = $rs["name"]; $this->tekst = $rs["tekst"]; $this->email = $rs["email"]; $this->title = $rs["title"]; } private function sendMail(){ $mail = new PHPMailer(); $mail->Priority = 3; $mail->Encoding = "8bit"; $mail->CharSet = "iso-8859-1"; $mail->From = $this->email; $mail->FromName = $this->name; $mail->AddReplyTo($this->email, $this->email); $mail->Sender = $this->email; if($_SESSION["email"]!=""&&isset($_SESSION["email"])){ $mailto = $_SESSION["email"]; }else{ $mailto = MAILTO; } //$mailto = "axel@molokini.be"; $mail->AddAddress($mailto,$mailto); $mail->Subject = CONTACTMAIL.$this->name; $mail->Body = "

".$this->title. "

"; $mail->Body .= "

".$this->tekst. "

"; $mail->IsHTML(true); $mail->WordWrap = 0; $error = $mail->Send(); } public function createCaptcha(){ $fonts[] = ASSETS."/fonts/arial.ttf"; $captcha = new PhpCaptcha($fonts); $captcha->Create(); } } ?>