Jump to content

mwtillman

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by mwtillman

  1. Same error message with no cr message...
  2. I only tried with crs in message. Do again with no cr message?
  3. Thank you. Both yield the same output - Parse error: syntax error, unexpected ';' inD:\Hosting\2229431\html\sendMail.php on line152
  4. Forgive me. I know there have been numerous questions on this issue. Using code I did not write. Works fine as long as message has no carriage returns. With CR, I am getting the following error - Warning: mail() [function.mail]: SMTP server response: 451 See djb/docs/smtplf.html.”>http://pobox.com/djb/docs/smtplf.html. in D:\Hosting\2229431\html\sendMail.php on line 152 I realize it must have something to do with \r\n but am not a coder. I want to fix this code as it also uses another script file to provide effects. Complete code follows - <?php /* * YOUR EMAIL *** */ $adminEmail = "[email protected]"; /* * VALIDATE EMAIL *** */ function validateEmail($email){ return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email); } /* * CHECK FORM *** */ $post = (!empty($_POST)) ? true : false; if($post) { $name = stripslashes($_POST['name']); $email = trim($_POST['email']); $subject = "Get In Touch Web Form Submission"; $message = stripslashes($_POST['message']); $error = ''; /* * CHECK MESSAGE *** */ if(!$message || $message == "Message") { $error = "Please, type in a message."; } /* * CHECK MAIL *** */ if($email && !validateEmail($email) || $email == "Email") { $error = "Please, check your e-mail address."; } if(!$email || $email == "Email") { $error = "Please, type in your e-mail address."; } /* * CHECK NAME *** */ if(!$name || $name == "Name") { $error = "Please, type in your name."; } /* * ACTION *** */ if(!$error) { $mail = mail($adminEmail, $subject, $message, "From: ".$name." <".$email.">\r\n" ."Reply-To: ".$email."\r\n" ."X-Mailer: PHP/" . phpversion()); if($mail) { echo 'ok'; } } else { echo '<p>'.$error.'</p>'; } } ?> Please help if you can.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.