$stamp) {
//$error[] = "You must wait 5 minutes between submissions.";
}
foreach($_POST as $key=>$value) {
$post[$key] = strip_tags($value);
}
$pn = $post["phone"];
$pn_regex = '.*([0-9]{3,3}).*([0-9]{3,3}).*([0-9]{4,4})';
$str = ereg_replace($pn_regex, '(\1)\2-\3', $pn);
if(strlen($post["name"]) < 1)
$error[] = "Please provide us with your first name.";
if(strlen($post["message"]) < 1)
$error[] = "You need to type a message";
if(strlen($post["message"]) > 10000)
$error[] = "Message is too long";
if(strlen($post["userEmail"]) > 1) {
if(!ereg("[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]", $post["userEmail"])) {
$error[] = "Please enter a valid e-mail address.";
}
}
if(strlen($post["userEmail"]) < 1)
$error[] = "Please provide us with your email address.";
if(strlen($error) > 0) {
foreach($error as $key=>$value){
$errorMsg .= "
".$value."";
}
$WhatMessage = '';
$WhatMessage .= $errorMsg;
$WhatMessage .= '
';
} else {
$ip = $_SERVER["REMOTE_ADDR"];
$body = "Submited by: ".$post["name"]."\n";
$body .= "Customers IP: ".$ip."\n";
$body .= "Customers Email: ".$post["userEmail"]."\n";
$body .= "Customers Phone: ".$str."\n";
$body .= "Best Time to Contact: ".$post["bttc"]."\n";
$body .= "Vehicle: ".$post["vehicle"]."\n\n";
$body .= "========================================================\n";
$body .= $post["message"]."\n";
$body .= "========================================================\n\n";
//$eol="\r\n";
//$mime_boundary=md5(time());
//
//$to = "mattl@dfweliteautorental.com";
//$subject = "Contact Form from EAR.com";
////$message = "Hello! This is a simple email message.";
//$from = $post["userEmail"];
//$fromname = $post["name"];
//$headers .= "From: ".$fromname."<".$from.">".$eol;
//$headers .= "Reply-To: ".$fromname."<".$from.">".$eol;
//$headers .= "Return-Path: ".$fromname."<".$from.">".$eol; // these two to set reply address
//$headers .= "Message-ID: <".time()."-".$from.">".$eol;
//mail($to,$subject,$body,$headers);
$sentFrom = 'no_reply@dfweliteautorental.com';
//list($email_name, $email_domain) = split("@", $sentFrom);
$hostname = 'dfweliteautorental.com';
require_once 'smtp.php';
$mail = new SMTP;
$mail->Delivery('client');
$mail->From($sentFrom, $sentFrom);
$mail->FromHost($hostname, $havemx);
if(!$havemx) die("The hostname: '".$hostname."' doesn't have a valid MX zone!");
$mail->AddTo('mattl@dfweliteautorental.com');
$mail->Text($body);
$sent = $mail->Send('Contact Form from EAR.com');
//require("class.phpmailer.php");
//
//$mail = new PHPMailer();
//
//$mail->IsSMTP(); // set mailer to use SMTP
//$mail->Host = "mail.dfweliteautorental.com;mail.dfweliteautorental.com"; // specify main and backup server
//$mail->SMTPAuth = false; // turn on SMTP authentication
//$mail->Username = "jswan"; // SMTP username
//$mail->Password = "secret"; // SMTP password
//
//$mail->From = $post["userEmail"];
//$mail->FromName = $post["name"];
//$mail->AddAddress("joshd949@yahoo.com", "Josh Davis");
//$mail->AddAddress("mattl@dfweliteautorental.com"); // name is optional
//$mail->AddReplyTo($post["userEmail"], $post["name"]);
//
//$mail->WordWrap = 50; // set word wrap to 50 characters
//$mail->AddAttachment(""); // add attachments
//$mail->AddAttachment("", ""); // optional name
//$mail->IsHTML(false); // set email format to HTML
//
//$mail->Subject = "Contact Form from EAR.com";
//$mail->Body = $body;
//$mail->AltBody = "";
//if(!$mail->Send())
//{
// echo "Message could not be sent. ";
// echo "Mailer Error: " . $mail->ErrorInfo;
// exit;
//}
//echo "Message has been sent";
$_SESSION["lastSubmission"] = date("U");
$WhatMessage = '
';
$WhatMessage .= $post["name"].", your message has been sent. Someone will respond to your question as soon as possible, and at your desired convenience.";
$WhatMessage .= '
';
$success = '1';
}
}
$meta = mysql_query("SELECT * FROM meta WHERE id='18'") or die(mysql_error());
$m = mysql_fetch_array($meta);
$d = $m["description"];
$k = $m["keywords"];
$pageType = '0';
$homePage = '0';
$pageTitle = 'Contact Us About Exotic & Luxury Car Rentals | Dallas, Houston, Austin, San Antonio, Fort Worth';
$pageDescription = $d;
$pageKeywords = $k;
include 'header.inc.php';
?>