hi i got this mail form that works but i got some problems with i get the mail sent to my email but in the mail it dont show the email submitted by the user from the form but my own mail.
can somebody tell me how the headers should bset in the code to
send the email to my mailbox showing the email set by the user
i also wonder if its possible to add a functin for sending acopy of the mail
to the user
/ thanks Lisa
//This page should not be accessed directly. Need to submit the form.
echo "error; you need to submit the form!";
$name = $_POST['name'];
$visitor_email = $_POST['email'];
$message = $_POST['message'];
echo "Name and email are mandatory!";
$email_from = 'firstname.lastname@example.org';//<== update the email address
$email_subject = "New Form submission";
$email_body = "You have received a new message from the user $name.\n".
"Here is the message:\n $message".
$to = "email@example.com";//<== update the email address
$headers = "From: $email_from \r\n";
$headers .= "Reply-To: $visitor_email \r\n";
//Send the email!
//done. redirect to thank-you page.
// Function to validate against any email injection attempts
$injections = array('(\n+)',
$inject = join('|', $injections);
$inject = "/$inject/i";
Sorry I should have been a little clearer. You need to change the form. The textbox that they enter their name into. That name needs to be "otheremail" then when the form is submitted you need to extract into a variable.
$otheremail = $_POST['otheremail'];
__________________ Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?