kapitan
kapitan

Reputation: 2232

Multiple Email Addresses Using Mail::to()

Will this work?

$email_address = '[email protected], [email protected]';

Mail::to($email_address)->send(new EmailTemplate($emailObject));

I've been googling around but I cannot find a definite answer.

Upvotes: 0

Views: 61

Answers (2)

Mehul Koradiya
Mehul Koradiya

Reputation: 129

$email_address = ['[email protected]','[email protected]'];

foreach($email_address as $email)
{
    Mail::to($email)->send(new EmailTemplate($emailObject));
} 

Upvotes: 1

dparoli
dparoli

Reputation: 9171

It should work better with an array:

$email_address = ['[email protected]', '[email protected]'];

Mail::to($email_address)->send(new EmailTemplate($emailObject));

Upvotes: 2

Related Questions