|
<% //
include('/var/www/docs/mc_templates/toolbox/library/mc_lib.html');
include('/var/www/docs/mc_templates/toolbox/library/tool_lib.html');
if($send)
{
if(!$name)
{
$errors .= "You must enter your Name.";
}
if(!$email_value && !($area_code && $prefix && $suffix))
{
$errors .= "You must enter your contact information (either your email or phone).";
}
if($email_value && !preg_match("#.+@.+\..+#",$email_value))
{
$errors .= "'$email_value' is not a valid email address. Ex: you@somewhere.com";
}
if(!$question)
{
$errors .= "You must enter your question.";
}
if($errors)
{ %>
Please correct the following errors:
<% }
else
{
if($email_value && ($area_code && $prefix && $suffix))
$notify_by = "email: $email_value and/or phone: ($area_code) $prefix-$suffix";
else if($email_value)
$notify_by = "email: $email_value";
else if($area_code && $prefix && $suffix)
$notify_by = "phone: ($area_code) $prefix-$suffix";
if(!$testMail)
{
$to = $mc->email;
}
else
{
$to = 'Test Ask Keller ,hauboldt@kw.com';
}
$from = 'KW.com-Ask_Keller ';
$subject = "A Question from $name";
$message = "Hello $mc->kwName,\n\nYou have received the following email from the 'Ask Keller' section of your market center website.\n\nHe/she asks the following question:\n $question\n\n$name would like to be contacted via $notify_by.";
while(!($mailed = mail($to,$subject,$message,"FROM: $from\n")) && ($i++ < 10));
if(!$mailed)
{
die("Error, could not send the message. ");
} %>
Thank you, your message has been sent successfully.
<% }
}
if(!$send || $errors)
{ %>
|
Have
a real estate question? Our agents have answers! Just tell us what
you would like to know and one of our agents will contact you with
the information you need.
(
* = required field )
|
<% } %>
|