Page 1 of 1
Anti-Flood stopping after sending the first batch
Posted: Fri Apr 06, 2007 12:50 am
by oth
Hi,
so I have 15 recipients, Anti-flood is setup to send the message to 5 recipients and stop for 2 seconds for testing basically.
Though when sending the first batch, the first 5 recipients, the script ends.
I have set_time_limit(0); ignore_user_abort(); before sending but I don't think it's that, because when I deactivate the plugin, it sends to the 15 recipients.
Any thoughts on what might cause that ?
Posted: Fri Apr 06, 2007 5:06 am
by Chris Corbyn
Show your code please.
Posted: Fri Apr 06, 2007 1:49 pm
by oth
Ok,
Though I'm using cakePHP and I use the swiftMailer component I wrote for it, anyway the component is here:
http://bin.cakephp.org/view/1053105011
I haven't tested fully to release it to the public 'cause the old one wasn't compatible.
and here is the send action
http://bin.cakephp.org/view/789992772
I can confirm that the values passed to setPause are 5 emails and 2 seconds
It's Cake code basically

Posted: Sat Apr 07, 2007 7:14 am
by Chris Corbyn
Hi, never actually registered that it was you making the post
I see you upgraded to v3

I'm not sure if I'm reading the code right (I had a long night out last night!) but is close() being called after every successful send? This could be counter-intuitive since AntiFlood would be governing when connections are closed if it's loaded. How are you dealing with the 15 recipients? Looping or passing an array?
PS: You may want to consider dropping the EasySwift usage (deprecated pretty quickly since everyone seems to just want the new API). I'd be happy to help rework your component to do this. It'll probably make things more flexible for you too, being broken into smaller units with specific jobs.
Posted: Sat Apr 07, 2007 8:19 pm
by oth
Hey
yea I upgraded to v3, the first step was to get it working that's why I used EasySwift, then as I wrote in the header of the file ( comments ) todo is to get ride of EasySwift
Help would be very appreciated, bear in mind though, Cake unlike other frameworks supports php 4 and 5 ( like Swift actually

) and I don't want to break this rule. We can collaborate by email if you wish, or MSN ?
yes I'm calling $this->mailer->close(); after send() oh I shouldn't ?
doesn't Antiflood reconnect anyway ? when should I call close then ? AntiFlood does it when it finishes ?
How are you dealing with the 15 recipients? Looping or passing an array?
I'd say passing an array, it's in the second paste, I call add which adds to an internal array, and that array is passed to EasySwift::send
Regards.