if( $error ) echo "
if( $error ) echo "
$success = false;
if( isset($_REQUEST['cSubmit']) ) {
$error = false;
$cName = trim(htmlentities($_REQUEST['cName']));
$cPhone = trim(htmlentities($_REQUEST['cPhone']));
$cEmail = trim(htmlentities($_REQUEST['cEmail']));
$cMessage = trim(htmlentities($_REQUEST['cMessage']));
$mailBody = "Name: ".$cName."
\n".
"Phone: ".$cPhone."
\n".
"Email: ".$cEmail."
\n".
"Message: ".$cMessage."
\n";
if( empty($cName) ) {
$error = true;
$errorMsg .= "You Must Supply a First and Last Name.
";
}
if( empty($cEmail) ) {
$error = true;
$errorMsg .= "You Must Supply an Email Address
";
}
require_once( "class.phpmailer.php" );
$mail = new PHPMailer();
$mail->IsHTML(true);
$mail->Subject = "Cohen & Fila Contact Form";
$mail->AddAddress("info@cohenandfila.com");
$mail->From = $cEmail;
$mail->FromName = $cName;
$mail->Body = $mailBody;
if( !$error ) {
if( $mail->Send() ) {
$success = true;
$successMsg = "Thank you for contacting our team. We have received your message and will reply back shortly. We look forward to speaking with you and thank you for contacting Cohen & Fila.";
} else {
$error = true;
$errorMsg = "Unable to Send Message. Please Try Again.";
}
}
}
?>