multiple mail recipients with CakePHP using bcc (the right insert method) -


i use php framework cakephp create web app. there,i want user insert in field many email addresses desires , hitting send button,a message emailed of emails.

to achieve that,i have use bcc.

my problem not know how can "read" user email addresses in right form use them in bcc.

till now,i have variable $to = $this->request->data['mail']['to']; ,where 'mail' model name,and in case user inserts 1 email address,the recipient receives mail correctly. how can enable receive multiple email addresses (maybe in array??) use variable $to @ piece of code:

$email = new cakeemail();  $email->from($from)     ->**bcc($to)**     ->subject($subject)     ->send($message); 

and welcomed :)

thank in advance!

there api ( http://api.cakephp.org/2.3/class-cakeemail.html#_addbcc ) , code open source. provide information looking for.

if open class cakeemail find ( https://github.com/cakephp/cakephp/blob/master/lib/cake/network/email/cakeemail.php#l482 ):

public function addbcc() 

which different bcc() since can used multiple times add multiple bcc addresses.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -