require_once('lib/class.phpmailer.php');
$IsData = 0;
$Name = 0;
$IsData = $_GET["IsData"];
$Name = $_GET["Name"];
if($IsData){
//check for valid data
$error = 0;
$errstr = "";
if(strlen($Name)<3){ // can do error checking here
//$error = 1;
//$errstr .= " Valid Name not given.";
}
if(!$error){
// EMAIL DATA TO US AND CLIENT
$msg = "The following data was submitted through BP Claims web form.
";
//$msg = "We have also stored a copy in our database for latter access if necessary. \n\n";
foreach($_GET as $tmpname => $tmpvalue) {
if(strcmp($tmpname,"PID") && strcmp($tmpname,"CompanyID") && strcmp($tmpname,"IsData")){
$msg .= "".$tmpname.": \t".trim($tmpvalue)."
";
}
}
$recipient = "";
// set up mail class
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "mail.megagate.com"; // example .... smtpout.secureserver.net"; // SMTP servers
$mail->SMTPAuth = false; // turn on SMTP authentication
$mail->Username = ""; // SMTP username
$mail->Password = ""; // SMTP password
$mail->From = "webform@wilsonattorney.com";
$mail->FromName = "BP Claims";
$mail->AddAddress("bpclaims@wilsonattorney.com","BP Claims");
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Data Submitted to Wilson Law Firm";
$mail->Body = $msg;
$mail->AltBody = "This is data submitted from the website";
$mail->Send();
}
}
?>
|