I ran into the same problem a long while ago.
And your right the to is a string but the component doesn't do
anything with the $to var except pass it off to the php mail function.

The way the php mail function processes the mail depends on how it is
configured. If you search for "php mail sending to more than one
email" you'll see almost all of the example solutions use a loop to
send the same email to multiple individual 'to' emails. The php mail
documentation indicates that you can send to multiple by separating
with a ',' but I've yet to see anywhere explain exactly how to
configure your mail subsystem to support it. I'm currently using
postfix on my local dev and local server. Not sure exactly what my
deployed host is using.

The problem has nothing to do with the email component but rather with
the email subsystem on the machine/host your running on. The php mail
documentation also gives plenty of warnings about differences between
windows and linux and weather or not you have a MTA running etc.

I think a single to recipient is a better design pattern as it keeps
the email address more private. It also allows better design for
sending to large groups as I believe there is a limit to the number of
email addresses. If I need to send to a group then I send to myself or
a blackhole email address and cc all the others. The only reason I
would do that is if I needed to allow or expected the recipients to
carry on a thread via reply to all.

I never did figure out how to setup my local mail system to handle
multiple to recipients, and I figured I would run into similar
problems with different host so I looked for a more manageable
solution.

I moved to the swiftmailer component to make better use of the SMTP
and ssl connections thus by passing most of whatever mail subsystem
was installed on the host and connecting directly to a known dedicated
smtp server. However I still send the email to one recipient.

You'll need to either send multiple copies of the same email to each
person via a loop
Or add the additional emails to the CC or BCC array.


On Jul 14, 9:17 pm, googong <[email protected]> wrote:
> Yes other options are fine
> -one "to" recipient,
> -one and many "cc" recipient.
> -one and many "bcc" recipient.
>
> I wonder why "to" option need to be string because cc and bcc are
> array and it works fine.
>
> On Jul 15, 6:37 am, nurvzy <[email protected]> wrote:
>
> > Can you get it to work with just one recipient? Because my first
> > question is if you (or your host) has setup sendmail properly.  You
> > can always use a SMTP server to send your mail which is usually
> > recommended for bulk email anyway.
>
> > Nick
>
> > On Jul 13, 9:27 pm, googong <[email protected]> wrote:
>
> > > Hi all,
> > > I follow the 
> > > documenthttp://book.cakephp.org/view/1284/Class-Attributes-and-Variables
> > > to send mail.
>
> > > "Address the message is going to (string). Separate the addresses with
> > > a comma if you want to send the email to more than one recipient."
>
> > > I tried to send many "to" email with separate comma like
> > > "[email protected], [email protected]" but nothing happen when run
> > > the script.
>
> > > Any suggestion?
> > > Thank you very much
> > > googong.

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