I ran into this the other day, I think the behavior is a bit
unexpected, and probably a bug.
If you do something like:
$this->Email->subect = 'Hi!';
$this->Email->from = '[EMAIL PROTECTED]';
foreach ($recipient as $r) {
$this->Email->to = $r;
$this->Email-send(sprintf($body, $r));
}
Essentially, setting up the basic email, and then looping over people
and sending by passing the body to send(), the contents of the body
get appended to the last send.
I believe this is essentially the same bug as:
https://trac.cakephp.org/ticket/3393
A simple fix is:
Index: cake/libs/controller/components/email.php
===================================================================
--- cake/libs/controller/components/email.php (revision 6636)
+++ cake/libs/controller/components/email.php (working copy)
@@ -289,6 +289,7 @@
*/
function send($content = null, $template = null, $layout =
null) {
$this->subject = $this->__encode($this->subject);
+ $this->__message = '';
$this->__createHeader();
if ($template) {
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---