Exemplo n.º 1
0
         $email = $_POST["email"];
         $valid_name = OutilsForm::valideNom($_POST["name"]);
         $valid_email = OutilsForm::valideEmail($_POST["email"]);
     }
     $subject = $_POST["subject"];
     $question = $_POST["question"];
     $message = $_POST["message"];
     // Si la clé du formilaire n'est pas valide
     $okPost = true;
     $valid_captcha = OutilsForm::valideCaptcha($_POST["captcha"]);
     $valid_subject = OutilsForm::valideSujet($_POST["subject"]);
     $valid_question = OutilsForm::valideSelect($_POST["question"], array("question", "remarque", "erreur"));
     $valid_message = OutilsForm::valideMessage($_POST["message"]);
     if (OutilsForm::valideFormulaireId("contact") && $valid_name && $valid_email && $valid_subject && $valid_question && $valid_message && $valid_captcha == 1) {
         $okForm = true;
         OutilsForm::resetCaptcha();
         $_SESSION['ContactEnvoye'] = true;
         $_SESSION['ContactEnvoyeTime'] = time();
         $headers = 'Content-Type: text/plan; charset="utf-8"' . "\r\n" . 'Content-Transfer-Encoding: 8bit' . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'From: ' . $name . ' <' . $email . '>' . "\r\n" . 'Reply-To: ' . $name . ' <' . $email . '>' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
         $subject = "Contact " . GsbConfig::$SiteShortUrl . " : " . $subject;
         $message = '[Mail from ' . GsbConfig::$SiteShortUrl . ']' . "\r\n\r\n" . 'Nom: ' . $name . "\r\n" . 'Sujet: ' . $subject . "\r\n" . 'Email: ' . $email . "\r\n\r\n" . 'Message' . "\r\n" . '--------' . "\r\n" . $message . "\r\n" . '--------' . "\r\n\r\n" . "Le: " . date("d/m/Y") . " a: " . date("H:i");
         try {
             if (@mail($email_send, $subject, $message, $headers)) {
                 $okMail = true;
             }
         } catch (Exception $e) {
         }
         unset($_SESSION["FormContactHashkey"]);
     }
 }
 // Si temps d'attende