leet8845 Posted October 17, 2007 Share Posted October 17, 2007 Hi there, Currentley my PHP code doesnt post a subject line for the email it creates. I want a set subject e.g 'web site contact form01' to be posted with the email my code generates. Is thispossible, if so how? Another thing I wish to do is send a automatic confirmation reply email to the sender. Is this possible with my current code? Any help with either of these, is truly appreciated! My code; <?php // Check email is not empty if (! empty ($_POST['Email']) ) { // Check name is not empty if (! empty ($_POST['Name']) ) { // Getformdataandcreateemail $Email2="lee@mymail.com"; $email=$_POST['Email']; $name=stripslashes($_POST['Name']); $name2=stripslashes($_POST['Name2']); $date=stripslashes($_POST['Date']); $number=stripslashes($_POST['Number']); $location=stripslashes($_POST['Location']); $destination=stripslashes($_POST['Destination']); $requirements=stripslashes($_POST['Requirements']); $hear=stripslashes($_POST['Hear']); $other=stripslashes($_POST['Other']); $message= <<<EOD -------------------------------- Enquiry from your website -------------------------------- Name: $name Name2: $name2 EmailAddress: $email Number: $number Location: $location Destination: $destination Date: $date Requirements: $requirements Hear about us: $hear Other: $other -------------------------------- End of Message -------------------------------- EOD; //Sendemail @mail($Email2,$subject,$message, "From:$Email2"); header("Location: http://www.mysite.com/error.html"); } else { // No email was sent header("Location: http://www.mysite.com/error.html"); } } else { // No name was sent header("Location: http://www.mysite.com/error.html"); } ?> Thanks for lookin Quote Link to comment Share on other sites More sharing options...
Orio Posted October 17, 2007 Share Posted October 17, 2007 Add before this line: @mail($Email2,$subject,$message, "From:$Email2"); This- $subject = "web site contact form01"; I guess your coder forgot to do that. What do you mean by automatic confirmation? These emails are being sent automatically... Orio. Quote Link to comment Share on other sites More sharing options...
leet8845 Posted October 17, 2007 Author Share Posted October 17, 2007 Thanks that worked perfect for the subject Sorry for not being clear, what I mean is a automatic confirmation email to be sent to the person who sends the form. Is the possible to be done on my code? Many Thanks. Quote Link to comment Share on other sites More sharing options...
leet8845 Posted October 18, 2007 Author Share Posted October 18, 2007 Can anyone tell me how to send a automatic reply email,? once a sender sends my form with the code above. Any help appreicated Regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.