I dont know what the problem could be.
Here's the Script
// SQL commands // E-Mail Content // Set $count to 0 $mail_users = ($mail_catch->email."<br>"); //Send the customers form e-mail.
<?php
// DB Info
$user = "user";
$pass = "password";
$db = "database";
$link = mysql_connect( "localhost", $user, $pass );
if ( ! $link )
die ( "Couldn't connect to mySQL" );
mysql_select_db( $db, $link )
or die ( "Couldn't open $db: ".mysql_error() );
$sql_select = "select email from users";
$result = mysql_query( $sql_select );
$subject_from = "YDI Mailing List - ".$subject."\nFrom:ydi-mailinglist@ydi.com\r\n";
$blank = " ";
$message_info = $message."\n\n
--------------------------------------------------------------------\n
Visit [domain.com...] for all your wireless shopping needs.\n
You have recieved this e-mail because you signed up for it. \n
If you recieve this e-mail twice, please reply with TWICE in \n
the title in capital letters so that we may fix the problem. \n
If you would like to stop receiving emails click below \n
--------------------------------------------------------------------
[domain.com...]
$count = 0;
while ( $mail_catch = mysql_fetch_object ($result) )
{
set_time_limit(400);
//Count how many e-mails the while loop sends to.
$count = ++$count;
mail($mail_catch->email,
$subject_from,
$blank,
$message_info)
or exit();
// Print out the emails it sent out to
print "(".$count.".) Sent out E-Mail to <b>".$mail_users."</b>\n";
}
// Dsiplay total of e-mails sent out
print "<br>The E-Mail was sent out to a total of <font size=4><b>".$count."</b></font> E-Mails.";
mysql_close( $link );
?>
I was being a dodo head. It was cutting out because one of the e-mails in the DB was not correct, it was missing the .com from it and so it would die out.
//Send the customers form e-mail.
mail($mail_catch->email,
$subject_from,
$blank,
$message_info)
or exit();
The blue part is why I'm a dodo head.