jcombs_31 Posted April 30, 2007 Share Posted April 30, 2007 Ok, so I've only used the mail function for sending contact forms, quotes, etc. Usually sending to just 1 or 2 recipients. I'm setting up my first newsletter service that the client can use to send out site updates/news, etc. I started out thinking this should be quite simple, set it up like a contact form and send it to my list stored in the mysql DB. But, my question is about when the list becomes quite big, would this cause problems with the script execution time? Any thoughts or concerns I should be aware of in creating this? Link to comment https://forums.phpfreaks.com/topic/49295-sending-newsletter/ Share on other sites More sharing options...
BrandonE97 Posted April 30, 2007 Share Posted April 30, 2007 Ive been wondering the same thing since I recently learned how to create a user DB and have a few members signed up. Can a simple while loop do or will that not be possible using the mail function? Link to comment https://forums.phpfreaks.com/topic/49295-sending-newsletter/#findComment-241589 Share on other sites More sharing options...
jcombs_31 Posted April 30, 2007 Author Share Posted April 30, 2007 bumptitybump Link to comment https://forums.phpfreaks.com/topic/49295-sending-newsletter/#findComment-241779 Share on other sites More sharing options...
BrandonE97 Posted April 30, 2007 Share Posted April 30, 2007 Huh? ??? Link to comment https://forums.phpfreaks.com/topic/49295-sending-newsletter/#findComment-241949 Share on other sites More sharing options...
AndyB Posted April 30, 2007 Share Posted April 30, 2007 Execution time isn't much of a problem, but 'flooding' the mailserver might be. You can avoid mailserver problems by including a counter and adding a short nap every n messages .... mail( .....); $mc++; if ($mc==20) { $mc = 0; sleep(1); // nap for a sec } .... Link to comment https://forums.phpfreaks.com/topic/49295-sending-newsletter/#findComment-241957 Share on other sites More sharing options...
jcombs_31 Posted May 1, 2007 Author Share Posted May 1, 2007 thanks Andy. Also, for privacy reasons, I guess I should use a loop and send a seperate mail messages to each user in the db rather that a comma seperated list of emails huh, or is there a better way? Link to comment https://forums.phpfreaks.com/topic/49295-sending-newsletter/#findComment-242198 Share on other sites More sharing options...
AndyB Posted May 1, 2007 Share Posted May 1, 2007 The better way is probably to out the addressees in the BCC field and [email protected] in the to field. There are some restrictions on how many addresses can be in bcc (I'm sure). Depending on how many addressees you have, you could probably send mails out bcc'd to groups of 20 at a time with the occasional sleep() Link to comment https://forums.phpfreaks.com/topic/49295-sending-newsletter/#findComment-242272 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.