我想在单个调用中使用sendmail将邮件发送给多个收件人。我正在使用cakephp 1.3。发送邮件到单个收件人工作正常。我想知道是否可以将邮件发送给多个收件人(通常是2-5个收件人)。使用sendgrid将邮件发送给多个收件人
$this->Email->smtpOptions = array('port'=>'587', 'timeout'=>'30', 'host' => 'smtp.sendgrid.net', 'username'=>'****', 'password'=>'****', 'client' => '***');
$this->Email->delivery = 'smtp';
$this->Email->from = 'Swiso Support <[email protected]>';
$this->Email->to = $user['email'];
$this->Email->subject = $title;
$this->Email->template = 'email';
$this->Email->sendAs = 'both';
$this->Email->send();
我可以将收件人数组传递给$this->Email->to
。
我很感激任何帮助。
为什么不看在CakePHP的手册? –
你在'to'字段中尝试过用逗号分隔的电子邮件吗? –