
January 26th, 2004
01:49 AM
[Solved] Maillist with the list on SQL server
fixed sry!
Last edited by FatBoy, January 26th, 2004 04:01 AM (Edited 1 times)

January 26th, 2004
04:03 AM

This works! 
<?php
include('../config.php');
include('../db/mysql.php');
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false);
if( isset($_POST['submit']) )
{
$sql = "SELECT email
FROM test_mail WHERE status = '1'";
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
// Now send the email
$to = $row['email'];
$subject = $_REQUEST["subject"];
$message = $_REQUEST["message"];
$headers = "From: bskzone.com staff <admin@bskzone.com>\r \n" .
"Date: " . date("r") . "\r \n";
if( !(mail($to, $subject, $message, $headers)) )
{
echo 'There was a problem sending the email. Please contact the system admin.';
exit;
}
}
echo '<body bgcolor="E5E5E5"><div align="center">
</div>
<table height="0" cellSpacing="0" cellPadding="0" width="420" align="center" border="0" style="font-family: Verdana; font-size: 12px; color: #000000" id="table3">
<tr>
<td vAlign="bottom" style="font-family: Verdana; font-size: 12px; color: #000000">
<img height="23" src="http://www.bskzone.com/templates/subSilver/images/box_top_left.gif" width="9" border="0"></td>
<td align="middle" width="100%" background="http://www.bskzone.com/templates/subSilver/images/box_top_bg.gif" style="font-family: Verdana; font-size: 12px; color: #000000">
<div align="center"><b>Mail MVP™ Tournament Participants </b></div></td>
<td vAlign="bottom" style="font-family: Verdana; font-size: 12px; color: #000000">
<img height="23" src="http://www.bskzone.com/templates/subSilver/images/box_top_right.gif" width="9" border="0"></td>
</tr>
</table>
<table height="0" cellSpacing="0" cellPadding="0" width="420" align="center" border="0" style="font-family: Verdana; font-size: 12px; color: #000000">
<tr>
<td style="border : 1px #555555 solid; padding : 0px;" background="http://www.bskzone.com/templates/subSilver/images/bsk_id_bg01.gif">
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" style="font-family: Verdana; font-size: 12px; color: #000000">
<tr>
<td height="20"> </td>
</tr>
<tr>
<td height="20" colspan="2" style="padding : 2px;"><div align="center"><strong>Mail sent to all paticipants!</strong></div></td>
</tr>
<tr>
<td height="20" colspan="2" style="padding : 2px;"><b> </b> </td>
</tr>
<tr>
<td style="background-color : #000000; height : 0px;" colSpan="2"></td>
</tr>
<tr>
<td height="25" background="http://www.bskzone.com/templates/subSilver/images/rowmid.gif" align="middle" colSpan="2">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table height="0" cellSpacing="0" cellPadding="0" width="420" align="center" border="0" style="font-family: Verdana; font-size: 12px; color: #000000" id="table6">
<tr>
<td vAlign="bottom" style="font-family: Verdana; font-size: 12px; color: #000000">
<img height="24" src="http://www.bskzone.com/templates/subSilver/images/box_down_left.gif" width="9" border="0"></td>
<td align="middle" width="100%" background="http://www.bskzone.com/templates/subSilver/images/box_down_bg.gif"> </td>
<td vAlign="bottom" style="font-family: Verdana; font-size: 12px; color: #000000">
<img height="24" src="http://www.bskzone.com/templates/subSilver/images/box_down_right.gif" width="9" border="0"></td>
</tr>
</table>
</body>';
}
else
{
echo '<body bgcolor="E5E5E5"><div align="center"><img src="http://www.bskzone.com/logos/mvp_tournament.gif"></div><br>
<form name="form1" method="post" action="">
<table height="0" cellSpacing="0" cellPadding="0" width="420" align="center" border="0" style="font-family: Verdana; font-size: 12px; color: #000000" id="table3">
<tr>
<td vAlign="bottom" style="font-family: Verdana; font-size: 12px; color: #000000">
<img height="23" src="http://www.bskzone.com/templates/subSilver/images/box_top_left.gif" width="9" border="0"></td>
<td align="middle" width="100%" background="http://www.bskzone.com/templates/subSilver/images/box_top_bg.gif" style="font-family: Verdana; font-size: 12px; color: #000000">
<div align="center"><b>Mail MVP™ Tournament Participants </b></div></td>
<td vAlign="bottom" style="font-family: Verdana; font-size: 12px; color: #000000">
<img height="23" src="http://www.bskzone.com/templates/subSilver/images/box_top_right.gif" width="9" border="0"></td>
</tr>
</table>
<table height="0" cellSpacing="0" cellPadding="0" width="420" align="center" border="0" style="font-family: Verdana; font-size: 12px; color: #000000">
<tr>
<td style="border : 1px #555555 solid; padding : 0px;" background="http://www.bskzone.com/templates/subSilver/images/bsk_id_bg01.gif">
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" style="font-family: Verdana; font-size: 12px; color: #000000">
<tr>
<td height="25" background="http://www.bskzone.com/templates/subSilver/images/rowmid.gif" colSpan="2"> </td>
</tr>
<tr>
<td style="background-color : #000000; height : 0px;" colSpan="2"></td>
</tr>
<tr>
<td style="padding : 2px;"><b> </b></td>
<td style="padding : 2px;"></td>
</tr>
<tr>
<td style="padding : 3px;" align="right" width="50%">
<b>Subject: </b>*</td>
<td style="padding : 3px;" vAlign="top" align="left" width="50%">
<input style="color : #000000; font: normal 11px Verdana; border-color : #B1BECC; background-color : #EEF5FF;" maxLength="150" size="50" name="subject" type="text">
</td>
</tr>
<tr>
<td align="right" valign="top" style="padding : 3px;"> <b>Message: </b>*</td>
<td style="padding : 3px;" vAlign="top" align="left">
<textarea name="message" cols="50" rows="10" style="color : #000000; font: normal 11px Verdana; border-color : #B1BECC; background-color : #EEF5FF;"></textarea>
</td>
</tr>
<tr>
<td style="padding : 3px;" align="right"> </td>
<td style="padding : 3px;" vAlign="top" align="left"> </td>
</tr>
<tr>
<td style="background-color : #000000; height : 0px;" colSpan="2"></td>
</tr>
<tr>
<td height="25" background="http://www.bskzone.com/templates/subSilver/images/rowmid.gif" align="middle" colSpan="2">
<input name="submit" type="submit" id="submit" value="Submit">
<input type="reset" id="reset" name="reset" value="Reset">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table height="0" cellSpacing="0" cellPadding="0" width="420" align="center" border="0" style="font-family: Verdana; font-size: 12px; color: #000000" id="table6">
<tr>
<td vAlign="bottom" style="font-family: Verdana; font-size: 12px; color: #000000">
<img height="24" src="http://www.bskzone.com/templates/subSilver/images/box_down_left.gif" width="9" border="0"></td>
<td align="middle" width="100%" background="http://www.bskzone.com/templates/subSilver/images/box_down_bg.gif"> </td>
<td vAlign="bottom" style="font-family: Verdana; font-size: 12px; color: #000000">
<img height="24" src="http://www.bskzone.com/templates/subSilver/images/box_down_right.gif" width="9" border="0"></td>
</tr>
</table>
</form>
</body>
';
}
?>
___________________
"Never meld machine and hamster lest ye unleash an orb of powerful satanic fury . . ."