我是Laravel的新手,我的目标是使用Mail::send()
方法发送多封邮件,可以使用to
或cc
参数。
我已经从.env
文件中检索到我的存储的电子邮件:
toEmails='one@domain.ext','two@domain.ext'
从
控制器
中检索电子邮件,并使用以下代码发送:$toEmails = env('toEmails');
$message->to(toEmails); OR $message->cc(toEmails);
以下代码一直出现错误:
Swift_RfcComplianceException in MailboxHeader.php line 345: Address in mailbox given [[email protected],[email protected]] does not comply with RFC 2822, 3.6.2.
我已经尝试了以下代码,但对我没有用。在.env
文件中。toEmails=array('one@domain.ext','two@domain.ext'),
toEmails=one@domain.ext,two@domain.ext'
我该如何从中恢复过来。