3 if(file_exists($this->path("libs")."ptitcaptcha.php")) require $this->path("libs")."ptitcaptcha.php";
5 class mw_forms_contact extends mw_mod
8 function validate(&$env)
9 { if($pages_view_mod = $env->get_mod("pages/view"))
10 { return $pages_view_mod->validate(&$env);
16 { if($env->config("contact_form") && $env->config("email"))
22 "[".$env->config("site_name")."] nouveau message",
24 $env->config("email"),
25 $env->config("captcha")
30 "Le message a été envoyé",
36 else $env->run("index");
39 function send(&$env, $from, $titre, $message, $dest, $captcha)
40 { $env->set_out("ENVOYE", false);
41 if($captcha && !file_exists($env->path("libs")."ptitcaptcha.php"))
42 { $env->erreur("fichier du captcha introuvable");
45 if(!$captcha || PtitCaptchaHelper::checkCaptcha())
54 ."Reply-To: ".$from."\r\n"
57 { $env->set_out("ENVOYE", true);
60 else $env->erreur("Erreur à l'envoi du mail");
62 else $env->erreur("Impossible de trouver l'email du destinataire");
64 else $env->message("merci de préciser un email");
66 else $env->message("anti-spam incorrect");