Hey Guys, I have some code written for a contact form which incorporates a CAPTCHA. It sends out an email to the assigned email address with the query. I want to keep the above mentioned functionality and also make it so the script sends out an automated response to the person who contacted us. Something in the lines of a "thank you" message. This is the code I have: <?php session_start(); if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) { // Insert you code for processing the form here, e.g emailing the submission, entering it into a database. unset($_SESSION['security_code']); $message = " Groupon Voucher Code: {$_POST['voucher']} Groupon Security Code: {$_POST['security']} Centre: {$_POST['centre']} First Name: {$_POST['firstname']} Sur Name: {$_POST['surname']} Email: {$_POST['email']} Preffered Time: {$_POST['preferredtime']} Additional Comments: {$_POST['comments']} "; $recipient = "email@domain.co.uk"; $subject = "Contact Form Subject"; $mailheader = "From: {$_POST['email']}"; mail($recipient, $subject, $message, $mailheader) or die ("Failure"); } else { sleep(2); header("location:failure.html"); } ?> Code (markup): Looking forward to some favorable responses. Thanks
just use mail function for him too... <?php session_start(); if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) { // Insert you code for processing the form here, e.g emailing the submission, entering it into a database. unset($_SESSION['security_code']); $message = " Groupon Voucher Code: {$_POST['voucher']} Groupon Security Code: {$_POST['security']} Centre: {$_POST['centre']} First Name: {$_POST['firstname']} Sur Name: {$_POST['surname']} Email: {$_POST['email']} Preffered Time: {$_POST['preferredtime']} Additional Comments: {$_POST['comments']} "; $recipient = "email@domain.co.uk"; $subject = "Contact Form Subject"; $mailheader = "From: {$_POST['email']}"; mail($recipient, $subject, $message, $mailheader) or die ("Failure"); mail($_POST['email'], "Thank you for ....", "Thanks :)", "From: youremail@adress.com"); } else { sleep(2); header("location:failure.html"); } ?> PHP: