selecting all emails from database and sending email
Started on the old forum in October 2009 · view the original in the archive · old links redirect here
try 'spam message sender' idea or search 'multiple email' i think:))
i have this script which also sends email after selecting all emails from your database but its not working for me its showing response error . So please can you correct the code blackhawk mate
<?php include("dbconnection.php"); if (!isset($_POST[''submit''])): ?> <html> <head> <title>Mailing List</title> </head> <body> <form method="post" action="<?=$_SERVER [''PHP_SELF'']?>"> <table align="center" bgcolor="#D6DEE7" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center"> **<h2>MAILING LIST ADMIN</h2>** Send message to: <select name="to" size="1" style="background- color: #F7F7F7"> <option selected value="all">Entire list <option value="notall">By country </select> Country: <select name="country" size="5"> <OPTION value="Argentina">Argentina <OPTION value="Bolivia">Bolivia <OPTION value="Brazil">Brazil <OPTION value="Chile">Chile <OPTION value="Colombia">Colombia <OPTION value="Costa Rica">Costa Rica <OPTION value="Ecuador">Ecuador <OPTION value="Guatemala">Guatemala <OPTION value="Honduras">Honduras <OPTION value="Mexico">Mexico <OPTION value="Nicaragua">Nicaragua <OPTION value="Panama">Panama <OPTION value="Paraguay">Paraguay <OPTION value="Peru">Peru <OPTION value="Puerto Rico">Puerto Rico <OPTION value="Rep. Dominicana">Rep. Dominicana <OPTION value="Uruguay">Uruguay <OPTION value="Venezuela">Venezuela </select> Title or Subject: <input name="subject" type=text maxlength=100 size=40> Message: <textarea wrap name="message" rows=10 cols=45></textarea> <input type=submit name="submit" value="SUBMIT"> </td> </tr> </table> </form> </body> </html> <?php else: $to = $_POST[''to'']; $subject = $_POST[''subject'']; $message = $_POST[''message'']; $country = $_POST[''country'']; if ("all" == $to) { $x = 1; $hold = 50; // quantity of emails sent before 3 sec delay $emails = mysql_query("SELECT email FROM members"); while ($sendemail = mysql_fetch_array ($emails)) { $email = $sendemail["email"]; mail($email, $subject, $message, "From:Your name <you@whatever.com>"); $x++; if($x == $hold) { // When $x is equal to $hold, a 3 sec delay will occur avoiding php to timeout sleep(3); $x = 0; } } // end of while loop } else { $bycountry = mysql_query("SELECT email FROM members WHERE country = ''$country''"); while ($countmail = mysql_fetch_array ($bycountry)) { $email = $countmail["email"]; $okemail = mail($email, $subject, $message, "From:Your name <you@whatever.com>"); $x++; if($x == $hold) { // When $x is equal to $hold, a 3 sec delay will occur avoiding php to timeout sleep(3); $x = 0; } } // end of while loop } ?> <html> <head> </head> <body> SUCCESS! </body> </html> <?php endif; ?>get some codes from the forgot password send to email
http://coding-talk.com/f16/lavalair-forgot-password-3685/index2.html
then change your msql query to select all emails
LDSWAPWORLD site closed. im busy with other things in life like facebook , send me PM so i can add you 🙂 www.pinoySG.com
don't ask for help if you're not even helping yourself! i am tired of seeing the line "best site", i want to see something NEW and UNIQUE. maybe if i find one, ill go back to my wap life again.
hello, i dnt know nthng about lava variables:( my snippet is just a idea about sending emails. you must adapt with your hands this or try to select emails with LIMIT 1 by status ON and deliver one by one(of corse insert status row on or of)
here is my script can you please try to help what wrong with this script that i am getting unknown reply with this too mate
<?php set_time_limit(0); ignore_user_abort(); mysql_connect( "database hostname" , "username" , "*****" ); mysql_select_db( "...." ); echo ''Database connected...''; $limit = 250; //however many emails you want to send at a time $pos = $_GET["pos"]; if(empty($pos)) { $pos = 0; } if ($pos == 0) { $sql = "SELECT email FROM users LIMIT 100"; } else { $sql = "SELECT email FROM users LIMIT "; $sql .= $pos; $sql .= '', ''; $sql .= $limit; } $result = mysql_query($sql); while($user = mysql_fetch_assoc($result)) { $email = $user[''email'']; mail($email , "...." , $body , "..."); echo $email; } $pos =$pos + $limit; echo '' <a href="''.$_SERVER[''PHP_SELF''].''?pos=''. $pos.''">Send to the next ''. $limit .'' entries</a></ p>''; ?>spider wrote: Thanks for the share
u said thanks. Have u tried it?
http://myfacepals.com MYFACEPALS SOCIAL NETWORKExternal image (may be gone)
you can' t send 50emails on each 3sec! that means 1000 per min?! most common servers don' t accept more than 200 per min. anyway if you want to send more than two you must respect the comma. ' ; ' ex: you@you.com; you@me.com; you@us.com; etc. try to print the result first.
This is pointless!! all its doing is sending spam mail, like blackhowk said most common servers don' t accept more than 200 per min. and imagine having about 10,000 members and sending emails to all, it will kill the server! i don't think any host will allow this on the servers.