'info@yourdomain.tld', 'name' => $_POST['name'], 'email' => $_POST['email'], 'subject' => $_POST['subject'], 'body' => $_POST['body'] ); // Proceed to check the $_POST data. $checkForm = new \security\forms\SecureMail($parameters); // Check the script timer to see how much time was spent. $spent_time = $checkForm->getTime(); if($spent_time == TRUE) { // Enough time has been spent, proceed scanning the $_POST data. $scan = $checkForm->fullScan(); // Did the scan found something? if($scan != FALSE) { // The class decided the $_POST data was correct. // Start sending the mail. $checkForm->sendmail(); // Show a message. $checkForm->sessionmessage('Mail sent!'); } else { // The class found something, we cannot send the mail. $checkForm->sessionmessage('Mail not sent.'); } } } // Show all session messages. $checkStatus = new \security\forms\SecureMail(); $checkStatus->showmessage(); // Destroy the session to finish. $checkStatus->destroysession(); } // Setup new secure mail form. $setup = new \security\forms\SecureMail(); // Clear any previous sessions messages. $setup->clearmessages(); // Create a secure token. $token = $setup->getToken(); // Place the token inside a server-side session. $_SESSION['token'] = $token; // Create some time to track how long a user takes to complete the form. $time = $setup->setTime(); // Try to detect a Robot on this form. If found, do you want to show a Captcha? $robot = $setup->detectrobot(); if($robot == TRUE) { // YOUR OWN CAPTCHA CODE HERE. // echo "Prove to us you are not a robot."; } ?>

Secure mail form.

Test form.