topical media & game development
server-webapi-code-03-emailMailingList.php / php
<?php
include ("../common_db.php");
subscribers, array('email' => "paul@example.com", 'format' => 1));
array_push(query = "SELECT id, source, title, DATE_FORMAT(date,'\%a, \%d \%b \%Y \%T EST') as
date, link, content FROM 03_feed_raw WHERE (NOW() - `date`) < 86400";
query);
//Produce HTML Version
updatedFeeds as htmlUpdate .= "<h3>{htmlUpdate .= "<font size=-1>{htmlUpdate .= "<p>{htmlUpdate .= "<a href=\"{item['link']}</a></p>\r\n";
htmlUpdate .= "<p>This email is sent as a service of example-corp. If you no longer wish to receive it, or wish to change subscription options please contact the help desk</p>";
plainUpdate = strip_tags(htmlHeaders = "MIME-Version: 1.0\r\n";
htmlHeaders .= "Content-type: text/html; charset=UTF-8\r\n";
plainHeaders .= "From: Daily Feed Updates <dailyfeed@example.com>\r\n";
subscribers as individual['format'] == 1)
{
if (!mail(htmlUpdate, error .= "Error To:{htmlHeaders\n";
}
}else if (individual['email'], "Daily Feeds", plainHeaders))
{
individual['email']}, Content: error == ""))
{
error;
file_put_contents("/tmp/feeederrors.txt", error";
}
?>
(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.