ninedoors Posted March 23, 2009 Share Posted March 23, 2009 I am having a problem emailing the members of my site at the same time. My host limits me to emailing 50 members at a time and only 50 members every five minutes. I have around 400 members and so I am wonderign if anyone else has run into this problem and what some possible solutions would be. Thanks for the help. Nick Link to comment https://forums.phpfreaks.com/topic/150694-emailing-members/ Share on other sites More sharing options...
shadiadiph Posted March 23, 2009 Share Posted March 23, 2009 I email all my email members individually I created field in my data base which is emailed and set it to 'No' as the default value then I call each member from the database one by one then send the email to $email called from the database WHERE emailed='No' then update the database changing emailed to Yes this is all done in an if link and when the database has no more memebers where emailed = No it goes to the else statement updates the database resets emailed to 'NO' then exits. Link to comment https://forums.phpfreaks.com/topic/150694-emailing-members/#findComment-791628 Share on other sites More sharing options...
shadiadiph Posted March 23, 2009 Share Posted March 23, 2009 here is my script beware i am using a DB Class so you might want to edit those bits. <?PHP ini_set ("display_errors", "1"); error_reporting(E_ALL); include("global/connection.php"); $sql = "SELECT * FROM tblmember WHERE emailed='No' order by intUserID DESC "; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $sid = $row["intUserID"]; $email = $row["email"]; $name = $row["name"]; } if ($email==true) { $to = "$email"; $subject = "$subject"; $MsgHeader = "From: Website <[email protected]> r\n"; $MsgHeader .= "MIME-Version: 1.0\n"; $MsgHeader .= "Content-type: text/html; charset=iso-8859-1"; $MsgBody = " <html> <head> <title>HTML message</title> </head> <body> <table> <tr><td>Hello $name</td></tr> </table> </body> </html>"; mail($to, $subject, $MsgBody, $MsgHeader); $sql01 ="update tblmember set emailed='Yes' where intUserID=$sid "; $DB_site->query($sql01); header("Location:submitletter.php"); exit; } else { $sql02 ="update tblmember set emailed='No'"; $DB_site->query($sql02); header("Location:index.php"); exit; } ?> hope this is of some help only problem is it will take 400 / 50 x 5 to execute it wont stop until it has mailed them all mm so 40 minutes i see your problem is the 50 every 5 minutes in your php ini file? Link to comment https://forums.phpfreaks.com/topic/150694-emailing-members/#findComment-791631 Share on other sites More sharing options...
shadiadiph Posted March 23, 2009 Share Posted March 23, 2009 i can't see anywhere by using php mail where it limits the amounts of emails you can send or are you using something else? Link to comment https://forums.phpfreaks.com/topic/150694-emailing-members/#findComment-791635 Share on other sites More sharing options...
ninedoors Posted March 23, 2009 Author Share Posted March 23, 2009 Ya, my host limits me to sending 50 emails every 5 minutes. If there is more they just dont send them. Link to comment https://forums.phpfreaks.com/topic/150694-emailing-members/#findComment-791655 Share on other sites More sharing options...
shadiadiph Posted March 23, 2009 Share Posted March 23, 2009 your host sucks then are you using mail like in the script i posted above? Is it 50 emails from one email address? Link to comment https://forums.phpfreaks.com/topic/150694-emailing-members/#findComment-791659 Share on other sites More sharing options...
ninedoors Posted March 23, 2009 Author Share Posted March 23, 2009 Ya, it has to do with the CIRC, which is the Canadian Internet Government. They are pretty tight with anything that looks like spam. Link to comment https://forums.phpfreaks.com/topic/150694-emailing-members/#findComment-791697 Share on other sites More sharing options...
shadiadiph Posted March 23, 2009 Share Posted March 23, 2009 thats sucks maybe modify what i posted may have to send the email from a different email after it hits number 50 Link to comment https://forums.phpfreaks.com/topic/150694-emailing-members/#findComment-791716 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.