Results 1 to 3 of 3
Thread: php doesnt send all mails !!!
-
05-09-2005, 07:11 AM #1Junior Guru Wannabe
- Join Date
- May 2004
- Posts
- 66
php doesnt send all mails !!!
i have a php script (newsletter) and it is in the nuke web system,
i have about 1000 member or mails.
when i send to the news letter members , the page takes a lot of time to load , and after 2 minutes nearly it stops , and the browser gives page unavailable.
i found that nearly 200 mails have been actually sent , but the rest was not fast enought to be sent before the termination of that action file.
After doing some inverstigation in the php code , i found that the whole time is spent in the line
mail("$sendto","newsletter",....) i mean the mail function... and this line is in a loop .
what possibly could let the mail function take this long time , i ll appreciate any answer from anybody who runned similar problem.
-
05-25-2005, 01:03 PM #2Junior Guru
- Join Date
- Sep 2004
- Location
- Chicago, IL
- Posts
- 214
in php.chf set the timeout or execution time to a much higher number; the other work around is to copy the addresses to a temp table and delete them from the temp table as they get sent.
-
05-25-2005, 02:04 PM #3Junior Guru Wannabe
- Join Date
- May 2005
- Posts
- 67
You might also want to consider having it process the emails in batches along the lines that blenard suggested. IE create a temp table, copy over say 100 addresses, send out the emails, delete the temp table, copy over the next 100 address, etc.
Also look into sorting those addresses and sending one email to all the email addresses in one domain. IE all the aol.com's, all yahoo.com's, etc. This way, ONE email message goes out, uses fewer resources both on your end and on the receiving mail server end. They will thank you. Though if your email message that gets sent out is personalized, then you're SOL and will have to send out each email seperately.