editnewsletter(); break; case 'newnewsletter': newnewsletter(); break; case 'savenew': savenew(); break; case 'deletenewsletter': deletenewsletter(); break; case 'saveedits': saveedits(); break; case 'sendnewsletter': sendnewsletter(); break; } function listnewsletters() { global $domain, $db; $r = $db->query('SELECT * FROM fas_newsletter ORDER BY pageid DESC limit 5 '); echo '<div class="heading"> <h2>Manage News letters</h2> </div> <br clear="all"> <a href=\'' . $domain . '/index.php?action=admin&case=newsletter&cmd=newnewsletter\' class="button">Create Letter</a> <table id="table"> <thead> <tr> <th>ID</th>
$statusofrecp = isvalidemail($_SESSION['recipients'][$_REQUEST['emailid']], $_SESSION['savednewsletterid'], $emailid); if ($statusofrecp == "old") { sendnewsletter($_SESSION['recipients'][$_REQUEST['emailid']], $_SESSION['field']['subject'], $newsletter_body, $_SESSION['field']['sendername'], $_SESSION['field']['senderemail']); $_SESSION['sentemails']++; } } else { $_SESSION['invalidemails']++; } $_SESSION['justsentemails'][] = $_SESSION['recipients'][$_REQUEST['emailid']]; } else { if (isvalidemailformat($_SESSION['recipients'][$_REQUEST['emailid']])) { //check either Subscriber is valid or not $emailid = RandomNumberGen("15"); $statusofrecp = isvalidemail($_SESSION['recipients'][$_REQUEST['emailid']], $_SESSION['savednewsletterid'], $emailid); if ($statusofrecp == "old") { sendnewsletter($_SESSION['recipients'][$_REQUEST['emailid']], $_SESSION['field']['subject'], $newsletter_body, $_SESSION['field']['sendername'], $_SESSION['field']['senderemail']); $_SESSION['sentemails']++; } } else { $_SESSION['invalidemails']++; } $_SESSION['justsentemails'][] = $_SESSION['recipients'][$_REQUEST['emailid']]; } echo '<br>' . $_SESSION['recipients'][$_REQUEST['emailid']] . ' <span style="color:#ff0000;">sent</span>'; } //Functions// //is Valid email format or not function isvalidemailformat($email) { if (eregi("^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})\$", $email)) { return true;