professional-sql-03-scripts-digest.php / php
#! /usr/bin/php <?php // include shared code include '../lib/config.php'; include '../lib/db.php'; include '../lib/POP3Client.php'; // retrieve users to receive digest messages\ %sMAILLIST_USER WHERE IS_DIGEST = 1', DB_TBL_PREFIX); result = mysql_query(GLOBALS['DB']); // open digest file digest = QUEUE_DIR . '/digest-' . date('Ymd', digest)) { // no digest file mysql_free_result(body = file_get_contents(// send mail to each recipient while (row = mysql_fetch_assoc(row['EMAIL_ADDR'], 'List Digest for ' . date('m/d/Y', body, 'From: ' . LIST_EMAIL . "\r\n" . 'Reply-To: ' . LIST_EMAIL . "\r\n"); } mysql_free_result(GLOBALS['DB']); // delete digest file unlink(
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.