"; } */ if(empty($name)) { $error_msg .= "Please enter your name.
"; } if(!isValidEmail($email)) { $email = null; $error_msg .= "Please enter a valid email address.
"; } if(empty($friend_name)) { $error_msg .= "Please enter your friend's name.
"; } if(!isValidEmail($friend_email)) { $friend_email = null; $error_msg .= "Please enter a valid email address for your friend.
"; } /* if(empty($friend_phone)) { $error_msg .= "Please enter your friend's phone number.
"; } */ if($error_msg == null) { // Send referral to friend $cc = null; $bcc = null; $to = $friend_email; $from = $email; $subject = "Your friend ".$name." thought you would be interested in our Academy"; $msg_body .= "Hi ".$friend_name."

"; $msg_body .= "

Your friend ".$name." thought you would be interested in Phyls Academy and the services we have to offer. Recognized as one of the top Academies in South Florida, Phyls Academy helps shape the lives of hundreds of students and prepare them for the future.

"; if(!empty($comment)) { $msg_body .= $name." said ...

".$comment."

"; } $msg_body .= "

Learn more about Phyls Academy by visiting our website at http://www.phylsacademy.com

"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: $from \r\n"; if($cc != NULL) $headers .= "Cc: $cc \r\n"; if($bcc != NULL) $headers .= "Bcc: $bcc \r\n"; $sent = mail($to, $subject, $msg_body, $headers); // Send info to school $cc = null; $bcc = null; $to = "cbaptiste@phylsacademy.com"; $from = "website@phylsacademy.com"; $subject = "Phyls Website Referred to ".$friend_name; $msg_body .= "Hi

"; $msg_body .= "

The Phyls Academy website was recently referred by ".$name." (".$email.") to ".$friend_name." (".$friend_email.")

"; if(!empty($friend_phone)) { $msg_body .= "

".$friend_name."'s phone number is ".$friend_phone."

"; } if(!empty($comment)) { $msg_body .= $name." said ...

".$comment."

"; } $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: $from \r\n"; if($cc != NULL) $headers .= "Cc: $cc \r\n"; if($bcc != NULL) $headers .= "Bcc: $bcc \r\n"; $sent = mail($to, $subject, $msg_body, $headers); if(!$sent) { $error_msg .= "Your mail could not be sent. Please try again. "; } } } ?>

Refer a Friend

* Denotes required fields

Professional Internet Solutions for Small Businesses - Solo Media Works