tags:

views:

128

answers:

1

I was testing this (nice) simple form from CSS Tricks. In a website hosted in Godaddy.

And I got the following warning:

Warning: mail() [function.mail]: SMTP server response: 451 See

http://pobox.com/~djb/docs/smtplf.html in D:\Hosting\4923367\html\test\contactengine on line 32.

(I checked the page but i didn't see anything useful)

contactengine.php

<?php

$EmailFrom = "[email protected]";
$EmailTo = "[email protected]";
$Subject = "Nice & Simple Contact Form by CSS-Tricks";
$Name = Trim(stripslashes($_POST['Name']));
$Tel = Trim(stripslashes($_POST['Tel']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));

// validation
$validationOK=true;
if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  exit;
}

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Tel: ";
$Body .= $Tel;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";

// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page
if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>

Any suggestions?

+3  A: 

This link provides a solution. Try replacing your newlines with \r\n

In mail message headers and content, new lines are supposed to be denoted by both a carriage return (CR) and a line feed (LF)

injekt
@injekt Yes, sorry I totally forgot about this ha.
janoChen