include("/home/cbhearth/_inc/mail/Mail.php"); $id = isset($_GET['id']) ? $_GET['id'] : $_POST['id']; $feed = isset($_GET['f']) ? $_GET['f'] : $_POST['f']; $emailsent = "N"; if(isset($_POST['sendmail'])) { include("/home/cbhearth/_inc/securimage/securimage.php"); $code = $_POST['code']; if (isset($code) == false) { $errMsg = "Please validate the security code"; } else { $img = new Securimage(); $valid = $img->check($_POST['code']); if($valid == false) { $errMsg = "Sorry, the code you entered was invalid, please try again."; } } if (isset($errMsg) == false) { $friendName = $_POST['friendName']; $friendAddress = $_POST['friendAddress']; $message = $_POST['message']; $senderName = $_POST['senderName']; $senderAddress = $_POST['senderAddress']; $msg = $friendName.",\n\n"; $msg .= $message."\n\n"; $msg .= $senderName."\n"; $to = $friendAddress; $recipients = $to; $headers['From'] = 'info@cbhearthside.com'; $headers['To'] = $to; $headers['Subject'] = "CBHearthside.com Listing #$id"; $headers['Reply-To'] = $senderAddress; // Create the mail object using the Mail::factory method $mail_object =& Mail::factory('smtp', $params); $send = $mail_object->send($recipients, $headers, $msg); if (PEAR::isError($send)) { $errMsg = "There was a problem"; } else { $emailsent = "Y"; } } } ?>
Your email has been sent, thank you for your interest!
} else { if (isset($errMsg)) { echo "To send an email regarding the property just enter the information requested below and click Send Email.