I'm going to change my handle to the pest I think. I'm just full of problems this week :lol:
I'm trying to set up the program to e-mail everyone in my opt in mailing list. I have a table set up in my database to hold all the e-mail addresses, and I'm trying to make a simple form to send the mails. There seems to be some problem in the script; however, because the form will sumit, act like it is working, but the e-mails are not being sent. here is the code I'm passing the information to. it is being done through PHP_SELF.
<?
if($sumbit)
{
mysql_connect(localhost,$user,$pass) or die("Could Not Connect to the Database");
mysql_select_db($db) or die("Could Not Connect to the database");
$count = 0;
$result = mysql_query("SELECT * FROM mailinglist ORDER BY id DESC") or die("Could Not Query the Database");
while ($row = mysql_fetch_array($result)) {
$recipient = $row['email'];
$additional_headers = "FROM: [email]list@myserver.com[/email]";
mail($recipient,$subject,$message,$additional_headers) or die("Could Not Send the Mail");
$count++;
}
echo "<center>Message sent to $count user(s)</center>");
}