Please click here to check out this article."; } else{ $url = "Please click here to check out this article."; } //SEND THE EMAIL $email_body = read_file($email_template); $email_body = str_replace("##name##", $name, $email_body); $email_body = str_replace("##comments##", $comments, $email_body); $email_body = str_replace("##url##", $url, $email_body); if ($to_email_1 != ""){ phpmail($from_email, $to_email_1, $subject, $email_body, "html"); $email_sent = "1"; } if ($to_email_2 != ""){ phpmail($from_email, $to_email_2, $subject, $email_body, "html"); $email_sent = "1"; } if ($from_email != "" && $to_email_1 != ""){ $to_email = ($to_email_2 != "")?($to_email_1 . ", " . $to_email_2):($to_email_1); $message = str_replace("'", "", $message); $type_str = ($type == "tvc")?"T":"A"; $ins_qry = "INSERT INTO SendEmails(ArticleId, FromEmail, ToEmail, Message, Type) VALUES('$article_id', '$from_email', '$to_email', '$comments', '$type_str')"; $ins_res = mysql_query($ins_qry) or die(mysql_error()); } } if ($email_sent == "1"){ ?>
Email has been sent. Thank you!
   
Your Name :
Your Email :
Friend's Email 1 :
Friend's Email 2 : (optional)
Comments :