Jezthomp Posted March 5, 2007 Share Posted March 5, 2007 I have the following form <div id="emailContainer"> <?php ini_set("sendmail_from", "mailserver@********.co.uk"); if ($_POST["Submit"]) { // if we dont have all the info we want then we will output an error message if ((!$_POST["name"]) OR (!$_POST["email"])) { // We do not have all the info we need so output error print "<br>You have not given us all the information we need to process the form.<br>"; print "Please use the browser back and/or refresh button to go back and edit the form."; }else{ // We have the info we need so lets send the info in an email $recipient = "Website Enquiry <[email protected]>"; $subject = "Evacuee Website Enquiry Form"; // Lets get all the info from the form and so we can send it in the email $name = $_POST["name"]; $telNum = $_POST["telNum"]; $email = $_POST["email"]; $comments = $_POST["comments"]; $message = "WEBSITE CONTACT FORM: ____________________________________________ Contact Info: Name: $name E-Mail Address: $email Contact No: $telNum ____________________________________________ Comments: Comments: $comments "; $extra = "From: $name <$email>"; // actually send the mail mail ($recipient, $subject, $message, $extra); // Print thank you message print "Many Thanks $name! for contacting us, we shall get back to you as soon as possible..."; } } else { ?> <form action="<?php print $_SERVER['PHP_SELF']; ?>" method="post" name="form1"> <fieldset> <legend>Please fill out the form below for any further enquiries. TESTING </legend> <div class="field"> <label for="name">Name: <span class="required">*</span></label> <input class="text" id="name" maxlength="64" name="name" size="24"type="text"/> </div> <div class="field"> <label for="email">Email Address: <span class="required">*</span></label> <input class="text" id="email" name="email" size="32"type="text"/> </div> <div class="field"> <label for="telNum"><span>Tel No:</span></label> <input name="telNum" class="text" id="telNum"size="32" type="text"/> </div> <div class="field"> <label for="comments"><span>Comments:</span></label> <textarea name="comments" cols="31" rows="5" class="text" id="comments"></textarea> </div> <div class="field"> <input name="Submit" type="submit" class="submit" value="Submit" /> </div> </fieldset> <div></div> </form> <?php } ?> </div> Now it works on this site phpinfo which has PHP Version 4.3.2 on it However, i am using the same form on another site and its not workingphpinfo which has PHP Version 4.4.4 on it. The form sends ok and you get the confirmation line but the email is not delivered. I have been scratching my head over this one for a while, any ideas anyone? Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/41292-email-form-workin-on-1-site-not-on-the-other/ 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.