php - 在 Laravel 5.4 中向多个抄送收件人发送电子邮件

标签 php laravel email

我有一个发送电子邮件的函数,如下所示:

Mail::to($email)
->cc($arraywithemails)
->send(new document());

如何将电子邮件发送给多个抄送用户?我查了官方文档,但没有任何线索。

最佳答案

Mailable 中的 setAdress() 函数允许您提供一个数组作为参数:

Mailable.php

所以您应该能够通过传递数组作为参数来使用该函数

Mail::to($email)
    ->cc(['name1@example.com','name2@example.com'])
    ->send(new document());

关于php - 在 Laravel 5.4 中向多个抄送收件人发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43762735/

相关文章:

javascript - 我如何将 iCheck Checkbox 值传递给 Laravel?

http - Laravel angularjs http post 从输入返回 null

PHP、SMTP - 电子邮件中的主题将国际字符显示为 HTML_Entities

email - centos 7 同时在本地和远程保存 rsyslog

php - 未通过 gmail 收到 laravel 5 邮件

javascript - 如何完全实现消息轮询的服务器发送事件

php - 如何在 PDO 函数中使用 CURDATE() 进行多次插入

php - laravel 登录在 url 中显示密码和 id

php - WooCommerce 电子邮件通知 : different email recipient for different cities

php - 我的 mySQL_query 有什么问题?