I want to send mail using sendmail to multiple recipients in single call. I am using cakephp 1.3. Sending mail to single recipient works fine. I was wondering if I could send mail to multiple recipients(typically around 2-5 recipients).
$this->Email->smtpOptions = array('port'=>'587', 'timeout'=>'30', 'host' => 'smtp.sendgrid.net', 'username'=>'****', 'password'=>'****', 'client' => '***');
$this->Email->delivery = 'smtp';
$this->Email->from = 'Swiso Support <support@swiso.net>';
$this->Email->to = $user['email'];
$this->Email->subject = $title;
$this->Email->template = 'email';
$this->Email->sendAs = 'both';
$this->Email->send();
Could I pass an array of recipients to $this->Email->to .
I appreciate any help.
Googling “cakephp email” reveals this:
CakePHP 1.3 cookbook: Email
it should give you what you need: There is, for example, the
bccfield that allows you to send mails to multiple recipients.The book also has a chapter on sending multiple messages in a loop.