virtual Posted April 28, 2011 Report Share Posted April 28, 2011 I have been using the same php script to process my contact form on several different sites, and all of a sudden on the latest site I am building it is not sending the email and giving me an error message. All the other sites have the same code and are functioning properly, I don't understand what is wrong with this one. Warning: mail() [function.mail]: SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html.'>http://pobox.com/~djb/docs/smtplf.html. in D:\Hosting\7612246\html\mailresponse.php on line 102 I checked out http://pobox.com/~djb/docs/smtplf.html and it's some article written in 1995 which I don't understand. Line 102 is this one: mail("myemail@whatever.com", $subject, $message, $from); And here is the rest of the code: <?php $ip = $_POST['ip']; $httpref = $_POST['httpref']; $httpagent = $_POST['httpagent']; $visitor = $_POST['visitor']; $visitormail = $_POST['visitormail']; $notes = $_POST['notes']; $phone = $_POST['phone']; if (eregi('http:', $notes)) { die ("Do NOT try that! ! "); } if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Please hit the Back button</h2><h2>Please Enter a valid e-mail address</h2>\n"; $badinput = "<h2>Your email was NOT sent</h2>\n"; echo $badinput; die ("<p>Use browser back button !</p>"); } if(empty($visitor) || empty($visitormail) || empty($notes )) { echo "<h2>Please hit the Back button - fill in all fields</h2>\n"; die ("<p>Use browser back button !</p>"); } $todayis = date("l, F j, Y, g:i a") ; $phone = $phone; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Attention: $attn \n Message: $notes \n From: $visitor ($visitormail)\n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From: $visitormail\r\n"; mail("myemail@whatever.com", $subject, $message, $from); ?> <p class="mail">Thank you <?php echo $visitor ?> for expressing your interest in. Below is the information you entered on our form. We look forward to speaking with you and helping you get started on your new or existing project. </p> <p class="mail">Phone Number: <?php echo $phone ?></p> <p class="mail">Message:<br > <?php $notesout = str_replace("\r", "<br>", $notes); echo $notesout; ?> </p> Quote Link to comment Share on other sites More sharing options...
Wickham Posted April 29, 2011 Report Share Posted April 29, 2011 Where is the variable $subject defined? Quote Link to comment Share on other sites More sharing options...
virtual Posted April 29, 2011 Author Report Share Posted April 29, 2011 Not to worry, it was a server issue with a Windows server, I changed to Linux and it works now. @Wickham, quite right I forget to define it. Thanks for pointing that out. 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.
Note: Your post will require moderator approval before it will be visible.