$errors[] = 'Username does not exist!'; } } } if ($subject == '') { $errors[] = 'Subject field cannot be empty!'; } elseif ($message == '') { $errors[] = 'Email message cannot be empty!'; } if (!$errors) { $mail = new VMail(); $mail->set(); $mail->Subject = $subject; $mail->AltBody = $message; $mail->Body = nl2br($message); $mail->AddAddress($rs->fields['email']); if ($mail->Send()) { $messages[] = 'Email was successfuly sent to <b>' . $username . '</b>!'; } else { $errors[] = 'Failed to send email! Please check your <a href="index.php?m=mail">Mail Settings</a> and make sure the provided email is valid!'; } } } $htmlCode = isset($_POST['htmlCode']) ? trim($_POST['htmlCode']) : NULL; $editor->set_code($htmlCode); $smarty->assign('email', $email); $smarty->assign('username', $username); $smarty->assign('specific', $specific); $smarty->assign('subject', $subject); $smarty->assign('editor_wp', $editor->return_editor('100%', 350));
} elseif ($_POST['htmlCode'] == "") { $err = "Please provide Message Body"; } if ($err != "") { echo "<script language='Javascript'>\n alert('{$err}');\n </script>"; } else { $code = stripslashes($_POST['htmlCode']); $code = longwordbreak($code, 40, ' '); $code = remove_tags($code, array('object' => true, 'embed' => true, 'applet' => true, 'script' => true)); $code = fixcharacters($code); $dt = Date("Y-m-d H:i:s"); $send = explode("-", $sendto); while (list($k, $v) = each($send)) { $sql = "Insert into msgboard(msgfrom,msgto,msgcaption,msgbody,msgdatetime,msgisread)\n values({$USERID},{$v},'{$msgcaption}','{$code}','{$dt}','no')"; $conn->Execute($sql); } echo "<script language='JavaScript'>\n parent.location.href='msgsuccess.php?sendto={$sendto}';\n </script>"; exit; } } $editor->set_code($_POST['htmlCode']); $txt = $editor->return_editor('100%', 300); //DECLARE COMMON SMARTY VALUES STemplate::assign('url', $config[baseurl]); STemplate::assign('imgurl', $config[imgurl]); STemplate::assign('site', $config[site_title]); STemplate::assign('txt', $txt); STemplate::assign('sendto', $sendto); STemplate::assign('mtype', $mtype); STemplate::display('siteadmin/test.tpl'); ob_end_flush();