lara data
lara data

Reputation: 25

How to send Multiple mail Using laravel?

i'm new to laravel, i need to send multiple emails using laravel it is possible ?

i'm try :-

 Mail::send('mail.Vehicle_request', compact('result_email'), function($message) use ($result_email) {
                    $message->to($result_email->email, $result_email->first_name . ' ' . $result_email->last_name)
                            ->subject('Vehicle Request');
                });

Thank You

Upvotes: 0

Views: 1285

Answers (1)

Jaswinder Singh
Jaswinder Singh

Reputation: 731

You can use mailable and send mail to multiple recipients adding them in the loop. You can refer more in the documentation link.

https://laravel.com/docs/8.x/mail

foreach (['[email protected]', '[email protected]'] as $recipient) {
    Mail::to($recipient)->send(new OrderShipped($order));
}

Upvotes: 1

Related Questions