It is stated the CakePHP manual, that you have to reset the Email
fields using the reset method as specified in:

http://book.cakephp.org/view/270/Class-Attributes-and-Variables#Sending-Multiple-Emails-in-a-loop-528

Your final flash message invokes the action "index" in the current
controller. What is the content of that action?
Enjoy,
   John

On Jan 26, 3:34 pm, alex <[email protected]> wrote:
> Hi, I'm trying to develop a mailing list .... In the controller
> CONTENTS there's a function called sendMailingList
> [code]
>                 $list = $this->Content->query("SELECT * FROM mails WHERE sub =
> '1'");
>                 $data = $this->Content->find($id);
>
>                 $this->Email->smtpOptions = array(
>                   .....
>                 );
>
>                 foreach($list as $info){
>                     $this->Email->subject = 'Test';
>                     $this->Email->replyTo = '[email protected];
>                     $this->Email->from = 'xxx <[email protected]>';
>
>                         $this->Email->to = '[email protected]';
>                         $this->Email->delivery = 'smtp';
>                         $this->Email->template = 'html/default';
>                         $this->Email->sendAs = 'html';
>                         $this->Email->to = $info['mails']['mail'];
>                         $this->set('title', $data['Content']['titolo']);
>                         $this->set('content_for_layout', 
> $data['Content']['descrizione']);
>                         $this->set('image', $data['Content']['link']);
>                         $this->set('mail', $this->Email->to);
>                         $this->Email->send();
>                 }
>
>                 $this->flash(__('Email sent', true), array
> ('action'=>'index'));
> [/code]
>
> it works for one email ( without foreach($list as $info){...} ), but
> when i trying to send with this method I see this nex pic...
>
> http://www.flickr.com/photos/davidale/4306633066/
>
> ...I wait your answers ....
>
> Thanks a lot!
> Alex.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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