Sending email to multiple cc recipients in Laravel 5.4

email, laravel, php

Solution

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(['name1@example.com','name2@example.com'])
    ->send(new document());

Problem

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.

Original source