Hello from a php Newbie,
I have a contact form at the bottom of this page:
http://www.keegan-lee.com/Minport/index.html
This is a responsive template which did not include a mail.php file. I would like it to validate and just return back to the form itself with a “Your message has been received…someone will get right back to you”
showing at the top of the form.
The following is the code I’m working with at the moment:
<?php //vars $subject = $_POST['subject']; $to = explode(',', $_POST['to'] ); $from = $_POST['email']; //data $msg = "NAME: " .$_POST['name'] ."\n"; $msg .= "EMAIL: " .$_POST['email'] ."
\n"; $msg .= "SUBJECT: " .$_POST['subject'] ."
\n"; $msg .= "COMMENTS: " .$_POST['comments'] ."
\n"; //Headers $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=UTF-8\r\n"; $headers .= "From: <".$from. ">" ; //send for each mail foreach($to as $mail){ mail($mail, $subject, $msg, $headers); } ?>
Thank you for your assistance…KL