Anti-Flood stopping after sending the first batch

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
oth
Forum Newbie
Posts: 7
Joined: Wed Apr 04, 2007 10:07 pm

Anti-Flood stopping after sending the first batch

Post 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 ?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Show your code please.
oth
Forum Newbie
Posts: 7
Joined: Wed Apr 04, 2007 10:07 pm

Post 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 :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Hi, never actually registered that it was you making the post :)

I see you upgraded to v3 8) 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.
oth
Forum Newbie
Posts: 7
Joined: Wed Apr 04, 2007 10:07 pm

Post 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 :D

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.
Post Reply