PDA

View Full Version : PHP Form and MISSING_MAILBOX_TERMINATOR@.SYNTAX-ERROR.


sketchmedia
02-01-2007, 04:46 AM
I have a contact form on a html page I created and it seems to sorta be working. The mail is getting to the inbox, but not sending response messages and I'm the following in the from field "FBC@, MISSING_MAILBOX_TERMINATOR@.SYNTAX-ERROR."

Here is the php script I'm using can anyone help?

<?php
// Website Contact Form Generator

// get posted data into local variables
$EmailFrom = "FBC West";
$EmailTo = "[email protected]";
$Subject = "Email from Website";
$FirstName = Trim(stripslashes($_POST['FirstName']));
$LastName = Trim(stripslashes($_POST['LastName']));
$Email = Trim(stripslashes($_POST['Email']));
$Phone = Trim(stripslashes($_POST['Phone']));
$Comments = Trim(stripslashes($_POST['Comments']));

// validation
$validationOK=true;
if (Trim($FirstName)=="") $validationOK=false;
if (Trim($LastName)=="") $validationOK=false;
if (Trim($Email)=="") $validationOK=false;
if (Trim($Phone)=="") $validationOK=false;
if (Trim($Comments)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=contacterror.html\">";
exit;
}

// prepare email body text
$Body = "Someone at fbcwest.com left this information:";
$Body .= "\n";
$Body .= "\n";
$Body .= "Name: ";
$Body .= $FirstName;
$Body .= " ";
$Body .= $LastName;
$Body .= "\n";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Comments: ";
$Body .= $Comments;
$Body .= "\n";

// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
$success = mail ("$Email","Thank You for visiting the FBC West Website",
"Hello $FirstName,\n
This confirms your email was sent. Someone will be getting back with you shortly. Thank you for visting the FBC West Website.\n
Sincerely,
FBC West
www.fbcwest.com","FROM:FBC West") ;

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

Cota
02-01-2007, 06:46 AM
$EmailFrom = "FBC West"; Needs to be an email address