LiL|aaron
09-01-2006, 03:34 PM
Hi,
I wrote this but nothing seems to happen, no errors.. no text nothing! nothing wrong with the server or settings in the php.ini because i have other scripts like this working... i think i might be a type error or something... just cant see any ....
<?
error_reporting(E_ALL);
require("/quest/conf/mysql.inc.php");
require("/quest/conf/mail.inc.php");
$today = date("Y-m-d");
$query = mysql_query("SELECT DISTINCT * FROM daily_devotions WHERE `date` <= '$today'") or die(mysql_error());
$rows = mysql_fetch_array($query);
echo '<b>The Daily Devotion For '.$rows['date'].'</b><BR><BR>';
echo '<b>Title:</b> '.$rows['name'].'<BR><BR>';
echo '<b>Devotion:</b><BR><BR>'.$rows['text'].'<BR><BR>';
$query2 = mysql_query("SELECT DISTINCT * FROM mail_devo ORDER BY email") or die(mysql_error());
$row = mysql_fetch_array($query2);
$title = 'Daily Devotionals';
$content = 'Dear '.$row['name'].',<BR><BR>A New Daily Devotional Is Available!<BR>Called: '.$rows['name'].' <BR><BR>Please Goto <a href="http://www.questministries.com" target="_blank">http://www.questministries.com</a><BR><BR>Kind Regards,<BR>Quest Ministries';
$subject = $title;
$message = $content;
$headers = "From: $from_address\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
foreach ($row['email'] as $addr)
{
print '   Sent email to ' . $addr . '<br>';
mail($addr, $subject, $message, $headers);
}
?>
Thanks
Aaron
I wrote this but nothing seems to happen, no errors.. no text nothing! nothing wrong with the server or settings in the php.ini because i have other scripts like this working... i think i might be a type error or something... just cant see any ....
<?
error_reporting(E_ALL);
require("/quest/conf/mysql.inc.php");
require("/quest/conf/mail.inc.php");
$today = date("Y-m-d");
$query = mysql_query("SELECT DISTINCT * FROM daily_devotions WHERE `date` <= '$today'") or die(mysql_error());
$rows = mysql_fetch_array($query);
echo '<b>The Daily Devotion For '.$rows['date'].'</b><BR><BR>';
echo '<b>Title:</b> '.$rows['name'].'<BR><BR>';
echo '<b>Devotion:</b><BR><BR>'.$rows['text'].'<BR><BR>';
$query2 = mysql_query("SELECT DISTINCT * FROM mail_devo ORDER BY email") or die(mysql_error());
$row = mysql_fetch_array($query2);
$title = 'Daily Devotionals';
$content = 'Dear '.$row['name'].',<BR><BR>A New Daily Devotional Is Available!<BR>Called: '.$rows['name'].' <BR><BR>Please Goto <a href="http://www.questministries.com" target="_blank">http://www.questministries.com</a><BR><BR>Kind Regards,<BR>Quest Ministries';
$subject = $title;
$message = $content;
$headers = "From: $from_address\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
foreach ($row['email'] as $addr)
{
print '   Sent email to ' . $addr . '<br>';
mail($addr, $subject, $message, $headers);
}
?>
Thanks
Aaron