"") { $agentID = $_GET[AgentID]; } if ($_POST[AgentID] <> "") { $agentID = $_POST[AgentID]; } $q1 = "select * from cpt_agents where AgentID = '$agentID' "; $r1 = mysql_query($q1) or die(mysql_error()); $a1 = mysql_fetch_array($r1); if(isset($_POST[z2]) or $_POST[z1] <> "") { $to = $a1[email]; $subject = $_POST[subject]; $message = $_POST[message]; $message .= "\n\nProperty:\n$site_url/info.php?id=$_POST[ListingID]\n\n"; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/plain; charset=iso-8859-1\n"; $headers .= "Content-Transfer-Encoding: 8bit\n"; $headers .= "From: $_POST[u_name] < $_POST[u_email] >\n"; $headers .= "X-Priority: 1\n"; $headers .= "X-MSMail-Priority: High\n"; $headers .= "X-Mailer: PHP/" . phpversion()."\n"; mail($to, $subject, $message, $headers); $thankyou = "



Thank you, your message has been sent!

back to the property details
"; //get the templates require_once("templates/HeaderTemplate.php"); require_once("templates/EmailThankyouTemplate.php"); require_once("templates/FooterTemplate.php"); exit(); } $AgentName = "$a1[FirstName] $a1[LastName]"; if(!empty($_GET[ListingID])) { $SubjectLine = "Property ID $_GET[ListingID]"; } //get the templates require_once("templates/HeaderTemplate.php"); require_once("templates/EmailTemplate.php"); require_once("templates/FooterTemplate.php"); ?>