Jump to content

Problem with contact form script


virtual

Recommended Posts

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>

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...