Welcome Guest, Not a member yet? Register   Sign In
Help: Sending Mass Emails
#1

[eluser]Unknown[/eluser]
Hi,

I'm really a newbie when it comes to this so I was wondering what would be the best practice on sending mass emails, kinda like for a newsletter.

I was thinking that I can run a loop but then the server would time out on me if the script timeout settings is set.

Thank you, Any advice would be highly appreciated.
#2

[eluser]Phil Sturgeon[/eluser]
Server will time-out if there is a stupid-HUGE number of emails but its easy to avoid.

I normally have it output a bit of javascript code after every x number emails that will count down 5 seconds then continue on. I imagine the same could be done by using

Code:
class Page extends Controller()

function mass_email($startFrom = 0){
$counter = 1;
for($i=$startFrom; $i <= 1000 or whatever; $i++):
if($counter == 20) redirect('page/'.$i + 1, 'refresh');
$counter++;
endforeach;
}

}

Something simple like that.
#3

[eluser]marcoss[/eluser]
[quote author="thepyromaniac" date="1182923434"]Server will time-out if there is a stupid-HUGE number of emails but its easy to avoid.

I normally have it output a bit of javascript code after every x number emails that will count down 5 seconds then continue on. I imagine the same could be done by using

Code:
class Page extends Controller()

function mass_email($startFrom = 0){
$counter = 1;
for($i=$startFrom; $i <= 1000 or whatever; $i++):
if($counter == 20) redirect('page/'.$i + 1, 'refresh');
$counter++;
endforeach;
}

}

Something simple like that.[/quote]

Yup, i use the same approach, not for email, but for database replication (long story) and it works just fine.




Theme © iAndrew 2016 - Forum software by © MyBB