} if ($_GET['proc'] == "del") { foreach ($_POST['frmDelete'] as $key => $value) { $query = "DELETE FROM " . $phpml['dbMsgs'] . "\n WHERE msgid = {$key}"; $result = mysql_query($query) or die($PHPML_LANG["error_query"] . mysql_error()); echo $PHPML_LANG["campaign"] . " ID " . $key . " " . $PHPML_LANG["deleted"] . "<br>"; } echo '<meta http-equiv="refresh" content="3;url=index.php?pg=campaigns" />'; } elseif ($_POST['sendemail'] || $_POST['savenosend']) { if ($_POST['sendemail']) { $query = "SELECT *\n FROM " . $phpml['dbLists'] . "\n WHERE listid = " . $_SESSION['def_list']; $result = mysql_query($query) or die($PHPML_LANG["error_query"] . mysql_error()); $row = mysql_fetch_assoc($result); $phpml['FromName'] = $row['listowner']; $phpml['FromAddy'] = $row['listemail']; _load_PHPMailer(); $mail = new MyMailer(); $mail->Subject = stripslashes($_POST['emailtitle']); $message_org = stripslashes(stripslashes($_POST['frmEditor'])) . "</div>"; $query = "SELECT *\n FROM " . $phpml['dbMembers'] . "\n WHERE listid = '" . $_SESSION['def_list'] . "'\n AND confirmed = '1'\n AND deleted = '0'"; $result = mysql_query($query) or die($PHPML_LANG["error_query"] . mysql_error()); $num = mysql_num_rows($result); $x_ok = 0; // current count of sent in emails processed $x_errors = 0; // current count of errors in emails processed $xi = 0; // current count of emails processed $width = 0; // the starting width of the progress bar $percentage = 0;
function send_message($address, $message) { global $phpml; require_once $phpml['PHPMailer_path'] . "/class.html2text.php"; // added by Steve Morton $rc = false; if ($phpml['EmailSend']) { if (!class_exists("MyMailer")) { _load_PHPMailer(); } // code added by Steve Morton $h2t =& new html2text($message); $textmsg = $h2t->get_text(); // end of code added by Steve Morton $mail = new MyMailer(); $mail->Subject = stripslashes('[' . $phpml['ListName'] . '] Mailing List'); // code added by Steve Morton $mail->AltBody = $textmsg; $mail->MsgHTML($message); // end of code added by Steve Morton $mail->AddAddress($address); if (!$mail->Send()) { $_SESSION['return_msg'] = "There has been a mail error sending to " . $address . ": " . $mail->ErrorInfo; } else { $rc = true; } $mail->ClearAddresses(); } return $rc; }