mail function help

everything seems to be working with this form except in the email sent to me the $email from the form is not there ?
the subject,message and name are there but no email address from the form ???
any help !!!

<?php $email = $HTTP_POST_VARS['email']; $subject = $HTTP_POST_VARS['subject']; $message = $HTTP_POST_VARS['message']; $name = $HTTP_POST_VARS['name']; if (!preg_match("/w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*/", $email)) { echo "Please enter a valid email address"; echo "Back"; } elseif ($subject == "") { echo "Please enter a subject"; echo "Back"; } elseif (mail("[email protected]",$subject,$message,$name,$email)) { echo "Thank you for your enquiry.
A representative will get back to you shortly.

"; } else { echo "Cant send email to $email"; echo "Back"; } ?>


elseif (mail("[email protected]",$subject,$message,$name,$email))

to this:

else if mail("[email protected]",$subject,$message,"From:$name<$email>")

thanks carella !
that didnt exactly work ,but this did - happy happy joy joy

elseif (mail("[email protected]",$subject,$message,"From:$name<$email>"))

Sorry I missed the brackets, that was accidental.

Glad its now working ok. :)

Sponsor our Newsletter | Privacy Policy | Terms of Service