include "inc/site_variables.php";
define("MSG_TO","jhumfrey@mosaic-network.com");
define("MSG_CC","");
define("MSG_BCC","");
define("MSG_SUBJECT","Inquiry from Bantara.com");
define("USE_SMTP",false);
define("SMTP_HOST","");
define("SMTP_PORT","25"); // or 587
define("SMTP_USER","");
define("SMTP_PASS","");
import_request_variables("gp");
if ($mode == "sent") {
addMessages("Thank you. Your message has been sent to us successfully.");
}
if ($mode == "process") {
checkExists($name,"your name");
//checkExists($phone,"a phone number where we can reach you");
checkExists($email,"your e-mail address");
if ($email != "")
checkEmail($email,"your e-mail address");
if (trim($message) == "")
addErrors("Please tell us what you're contacting us about");
if (!isError()) {
require_once('inc/phpmailer/class.phpmailer.php');
$mail = new PHPMailer();
if (USE_SMTP) {
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = SMTP_HOST;
$mail->Port = SMTP_PORT;
$mail->Username = SMTP_USER;
$mail->Password = SMTP_PASS;
}
$mail->AddAddress(MSG_TO);
if (MSG_CC)
$mail->AddCC(MSG_CC);
if (MSG_BCC)
$mail->AddBCC(MSG_BCC);
$mail->From = $email;
$mail->FromName = $name;
$mail->Subject = MSG_SUBJECT;
$mail->Body = $message."\n\n".$name."\n".$email."\n".$phone;
$emailSent = $mail->Send();
if (!$emailSent) {
addErrors("We're sorry, but your message was unable to be sent, due to a technical error. Please try again. If you continue to experience difficulties, please email us at ".MSG_TO.".
".$mail->ErrorInfo);
}
else {
header("Location: ".$_SERVER["PHP_SELF"]."?mode=sent");
}
}
}
?>