Performance difference between send and batchsend?

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
kingstrife
Forum Newbie
Posts: 2
Joined: Fri Aug 24, 2007 8:00 am

Performance difference between send and batchsend?

Post by kingstrife »

Hi all,

i am puzzled by the performance difference between

1) for loop which executes the send N times

VS

2) a batch send which send N recipients

The reason for asking is that for every recipient, i would like to address them by their names in the message body. So method 1 would make it much easier. Will i get bad performance by looping the send() .

Thanks,
strife
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

You won't get bad performance using send() inside a loop, provided you re-use just one Swift_Message object and don't create new ones (I do some runtime caching which keeps things fast).

Have you looked at the decorator plugin?

http://www.swiftmailer.org/wikidocs/v3/ ... /decorator

:)
kingstrife
Forum Newbie
Posts: 2
Joined: Fri Aug 24, 2007 8:00 am

Post by kingstrife »

thanks for the quick reply! i will have a look at this!
Post Reply