Right on,

Thanks for the info.

Dave 

-----Original Message-----
From: Ivars Grīnbergs [mailto:[email protected]] 
Sent: October-06-09 6:01 AM
To: CakePHP
Subject: Re: Email error


Hello,

I faced this problem, too. I was surprised that Email component expects
ARRAYS ONLY in Cc and Bcc and simple STRINGS ONLY in To, From, Reply-to.

According to RFC 2822 section 3.6.3 "To", "Cc" and "Bcc" are comma-
separated list of one or more addresses. As well, according to section
3.6.2, "From" and "Reply-to" fields also are comma-separated list of one or
more addresses.

So, in Email component not only "Cc" and "Bcc" should be expected as arrays,
but also "To", "From" and "Reply-to".
Moreover, more cakey style (as it is in many other places) would be to
accept both the strings and arrays, and if necessary, seamlessly convert
(explode) comma-separated strings into arrays.

I did a little modifications to cake's core lib in order to meet my (quite
narrow) needs (it works only in case of smtp delivery method and it is
assumed that coma-separated string contains correctly formatted addresses)
and I am ready to share those modifications, so that someone can use it in
order to improve Email component.

With best regards,
Ivars

On Oct 6, 7:26 am, "Dr. Loboto" <[email protected]> wrote:
> $this->Email->bcc must be an array.
>
> On Oct 6, 10:10 am, "Dave Maharaj :: WidePixels.com"
>
> <[email protected]> wrote:
> > I get this error when sending an email with bcc
>
> > Warning (2) <javascript:void(0);> : Invalid argument supplied for 
> > foreach() [CORE/cake/libs/controller/components/email.php, line 714]
>
> > $this->Email->delivery = 'smtp';
> > $this->Email->to = $this->data['User']['email']; $this->Email->bcc = 
> > '[email protected]';
>
> > The email gets the the user but the copy to myself does not come thru.
>
> > Ideas why?
>
> > Thanks
>
> > Dave



--~--~---------~--~----~------------~-------~--~----~
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