...

View Full Version : Mass Mailer



king2k5
05-02-2006, 10:52 PM
Ok, i have a table in my database with 7k emails, i want to send them all out, thats the first problem.

Would this code be sufficient in doing so?


$query = "SELECT * FROM emailslastages";

$result = mysql_query($query);

$num = mysql_num_rows($result);



for($i=0; $i<=$num; $i++) {



$email = mysql_result($result, $i, "email"); // The email in the database...

$subject = "Dark Visions"; // Apply your subject

$msg = "We are proud to announce the release of Darkvisions.net,";

$msg.= "\n";

$msg.= "Dark Visions is a brand new MMORPG that has just launched publicly! In this game you can battle monsters, buy weapons and armor, and go on quests!\n";

$msg.= "Soon to come is: Playershops, More quests, PvP, Clans, and much much more!\n";

$msg.= "\n";

$msg.= "If you would come and try out Dark Visions im sure you will be pleased, we have got over 200 players in just 1 day! Come join our ever-growing community!\n";

$msg.= "\n";

$msg.= "http://darkvisions.net/\n";

$msg.= "\n";

$msg.= "-Administration\n";

$headers ="From: admin@darkvisions.net"; // Apply your headers



if($i % 20) { echo "\n\n<p>Zzz...</p>\n\n"; sleep(10); }



if(mail($email, $subject, $msg, $headers)) {

echo "<b>".number_format($i)."</b>: ".$email."<br>\n";

} else {

echo "<b>".number_format($i)."</b> FAILED: ".$email."<br>\n";

}



}

If not could you please advise me on what to change...

Second problem...

It takes FOREVER to send even half of these emails... could someone point me in a direction that could possibly not slow the hell outta my computer, and not take sooo long... maybe cronjobs? i dunno.. something rather than going to this file and waiting for hours and hours... thanks a lot!

king2k5
05-03-2006, 12:48 AM
*bump*

king2k5
05-03-2006, 08:02 PM
come on people!

king2k5
05-04-2006, 06:56 PM
nobody knows anything i guess?

lansing
05-04-2006, 10:18 PM
I am not sure how to answer your question, but you can Google for this & get programs & companies that offer mass mailing services for a price...

http://www.google.com/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial_s&hl=en&q=mass+mailer&btnG=Google+Search

king2k5
05-05-2006, 12:17 AM
nevermind, i made one myself.. it only took a couple minutes to send all 7k emails...


<?



include("Login_System_v.2.0/include/session.php");

$emailquery = mysql_query("SELECT * FROM emailslastages ");


while($emailrow = mysql_fetch_array($emailquery)){




$email = $emailrow['email']; // The email in the database...

$subject = "Dark Visions"; // Apply your subject

$msg = "We are proud to say that Dark Visions has been moved to a new server, and is operational again!,\n";

$msg.= "\n";

$msg.= "For those of you who never have joined yet, please stop by and check us out! We've made some great updates, with much much more coming!\n";

$msg.= "\n";

$msg.= "Some latest updates include the release of Playershops, and Clans, the playershops allow you to sell items to other people, and the clans allow you to get together with friends and plot against other people!\n";

$msg.= "\n";

$msg.= "Things soon to come: Sub-Classes for every race, 3 for each race, or 18 classes in total. PvP, which is Player vs Player... You will be able to draft an army and attack other members in the game! Clan upgrades... Soon you will be able to use the clan bank, and with that money you will be able to buy
a clan army, and clan upgrades... with those you can attack other clans! We also have skills in the making.. 9 skills in fact, some you may never have seen before! These are just some of the new updates going to happen within the next month, so come by and check us out!\n";

$msg.= "\n";

$msg.= "If you would come and try out Dark Visions im sure you will be pleased, we have got over 800 players in just 1 month! Come join our ever-growing community!\n";

$msg.= "\n";

$msg.= "http://darkvisions.net/\n";

$msg.= "\n";

$msg.= "-Administration\n";

$headers ="From: admin@darkvisions.net"; // Apply your headers


if(mail($email, $subject, $msg, $headers)) {

echo "<i>ID: ".$emailrow['id']."</i> <b>Email was sent to</b>: ".$email."<br>\n";

} else {

echo "<i>ID: ".$emailrow['id']."</i> <b>Email could not be sent to</b> FAILED: ".$email."<br>\n";

}



}



?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum