So I have been searching on and off for three days and looking at lots of tutorials. I went with a simple solution but that is not working.
So we have a site that needs to collect emails and mail them to us as well as sending a information email to the submitter after a successful submission. Now this information email has to come from one email but my boss wants the reply to email to be different. I got the form working to send the emails to us and then had an auto responder through our control panel sending the info mail out but you cannot change the reply to address so every time someone replies they will get the auto response. So what I am going to do is include the code I have for the submit form in here and I would like to know if a confirmation email code snippet can be included in this code before the thank page code or what? Advise me if I need to make new files etc. If you can give me new code snippets to make a confirmation/info email to add to my current code snippet tell me exactly where to put it. I am a huge noob to php.
[php]
"; echo $error."
"; echo "Please go back and fix these errors.
"; die(); } // validation expected data exists if(!isset($_POST['email'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $email_from = $_POST['email']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.
'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Email: ".clean_string($email_from)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?>
Coming Fall 2011
Copyright © 2011 oursite <?php } [/php] Thanks for your help