I just posted this in another mail a moment ago. It's an updated
component for using SwiftMailer[1] instead ofCake's EmailComponent.
SwiftMailer has a plugin named, AntiFlood, which allows one to set the
number of mails (from a large list of addresses) to send out in one
go, as well as a delay time between batches.

http://bin.cakephp.org/view/2015386698

Here's basic controller usage:

/**
 * SwiftMailer AntiFlood test
 *
 * @param       string  subject
 * @param       mixed   recipients      array of recipient addresses
 * @return      void
private function __sendBatch($subject, $recipients)
{
        $this->SwiftMailer->batch_send = true;
        
        if ($this->SwiftMailer->connect())
        {
                $this->SwiftMailer->newMessage($subject);
                $this->SwiftMailer->addAddress('from', YOUR_DEFAULT_ADDRESS);
                
                foreach($recipients as $recipient)
                {
                        $this->SwiftMailer->addAddress('to', $recipient);
                }                       
                
                $this->SwiftMailer->applyView('your_view', true);
                
                if (!$this->SwiftMailer->send())
                {
                        $this->set('msg', 'The mailer failed to connect. 
Errors:' .
pr($this->SwiftMailer->errors()));
                }
                else
                {
                        $this->set('msg', 'Msg sent.');
                }
                
                //$this->log(pr($this->SwiftMailer->transactions()));
        }
        else
        {
                $this->set('msg', 'The mailer failed to connect. Errors:' .
pr($this->SwiftMailer->errors()));
        }
}

[1] http://www.swiftmailer.org/

On Mon, Jan 12, 2009 at 6:34 AM, miracle <[email protected]> wrote:
>
> Hello,
>
> I need to send emails to 100's of users in my application and i am
> using cake php 1.2. Can you guys please help me which component to use
> for bulk emailing.??
>
> Thanks in advance,
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to