Multi Email send in Laravel | How to send multiple emails at once in laravel?

In this tutorial im going to share how to send multi email in laravel.  Follow this tutorial its define in very easy way.

composer create-project laravel/laravel multi-mail

After install go inside the project directory and open terminal and create one controller as define below.

php artisan make:controller MultiemailController

Copy below code and paste in your MultiemailController.php

namespace App\Http\Controllers;
use App\Mail\Multimail;
use Illuminate\Support\Facades\Mail;
use Illuminate\Http\Request;
class MultiemailController extends Controller
    public function index()
        return view('multiemail');
    public function send(Request $request)
     $this->validate($request, [
      'email'  =>  'required',
      'message' =>  'required',
     $admin_email = $request->email;
     $multimail = (explode(",",$admin_email));
     for($count = 0; $count < count($multimail); $count++)
      $data[] = array(
            'message' =>   $request->message,
            'email'   =>  $multimail[$count] );  }
    foreach($data as $d){
    $demail = $d['email'];
    Mail::to($demail)->send(new Multimail($d));
    return redirect('multiemail')->with('success', 'Mail has been sent successfully!');

Next to run below command

php artisan make:mail Multimail

Next to create view file inside this directory Resources/views/multiemail.blade.php

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Multi Mail using laravel 5.8 | Amit</title>
    <link rel="stylesheet" href="">
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
<div class="container">
    <div class="row">
        <div class="col-2"></div>
        <div class="col-8">
            <div class="alert alert-success mt-2">
                <button type="button" class="close" data-dismiss="alert">×</button>
                {{ session()->get('success') }}
            <div class="card">
                <div class="card-header">
                Multi Email Send in Laravel
                <div class="card-body">
                    <form method="post" action="{{ route('mailsend')}}" enctype="multipart/form-data">
                        <label for="">Email id</label>
                        <input type="email" class="form-control" placeholder="Enter email id" name="email" value="{{ old('email')}}">
                        <label>Enter Your Message</label>
                        <textarea type="text" name="message" class="w-100 p-2" placeholder="Enter your Message" value="{{old('message')}}"></textarea>
                        <button type="submit" name="send" class="btn btn-primary fa fa-send-o"> Submit </button>
        <div class="col-2"></div>

Next got to your route/web.php and paste below code

Route::get('/multiemail', 'MultiemailController@index')->name('multiemail');
Route::post('/multiemail/send', 'MultiemailController@send')->name('mailsend');

Next go to  App\Mail\Multimail.php

namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class Multimail extends Mailable
    use Queueable, SerializesModels;
    public $d;
     * Create a new message instance.
     * @return void
    public function __construct($d) {
        $this->d = $d; }
    public function build()
        return $this->from('')
        ->subject('New Message from anyone')
        ->with('d', $this->d);

Next to create one blade page


And add below code as mentioned

<p>Your Message {{ $d['message'] }}.</p>
<p>Your email Id {{ $d['email'] }}.</p>

Next add to mail trap credentials.

Next go to .env and add mailtrap credentials.

Next go to your terminal and paste below code.

php artisan serve

Now email sent successfully lets got to check mailtrap once email came or not.

Thanks for reading 👍👍.

Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.

Related Posts

Could not fetch

When I composer update in Laravel its throwing error could not fetch issues so let’s start to finish this issues. 1st step go to GitHub setting section….

Error: error:0308010C:digital envelope routines::unsupported

In this tutorial I’m going to share how to solve Error: error:0308010C:digital envelope routines::unsupported. Just copy below code and run your terminal. After run above all code…

API calls from the server require an appsecret_proof argument

In this tutorial im going to solve this issue API calls from the server require an appsecret_proof argument. 1st step go to developer facebook advance setting and…

How to Delete All Records Older Than 30 Days in Laravel 10 ?

In Laravel, you can use the Eloquent ORM to delete records older than a certain number of days. Here’s an example of how you can delete all…

How to safely remove Laravel Debugbar ?

What is Laravel Debugbar ? Laravel Debugbar is a package for the Laravel PHP framework that provides a debug bar or toolbar for your application. It offers…

Example of __construct and __destruct in laravel ?

In Laravel, PHP classes can have a constructor and destructor like any other PHP class. The constructor is called when an object is created, and the destructor…

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x