I have a function that sends an email like this:
Mail::to($email)
->cc($arraywithemails)
->send(new document());
How do I send the email to multiple cc users? I have checked the official documentation but there is no clue there.
You can add multiple Cc and Bcc by separating them with comma. Add the recipients in a column called "cc" for Cc recipients and "bcc" for Bcc recipients. To add multiple recipients, Cc or Bcc, just separate them with comma.
The setAdress() function in Mailable allow you to give an array as argument :
Mailable.php
So You should be able to use the function by passing an array as your argument
Mail::to($email)
->cc(['[email protected]','[email protected]'])
->send(new document());
That should work. From the offical Laravel documentation:
Mail::to($request->user())
->cc($moreUsers)
->bcc($evenMoreUsers)
->send(new OrderShipped($order));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With