• Techblog369, India
  • June 8, 2023

How To Configure A Sendinblue SMTP Relay in Postfix?

Fix Email Issues in CyberPanel with SMTP Relay Setup Free Method. First Create a email using your Cyberpanel Under Emai Tab Create Email Second go to the SSL tab and click …

Create a simple password strength indicator with JavaScript

You’ve probably seen many examples of password strength indicators around the web. They let users know the password they’re using is weak and indicate how the strength changes when it’s modified. …

Hi in this article i am going to show how to send multiple files attachment mail in Laravel. It’s simple example of Laravel send multiple attachment in mail. I explained simply step by step sending emails with multiple attachments.

so, let’s follow bellow steps:

Step 1 – Install Laravel Fresh Application

Use this command then download laravel project setup :

composer create-project --prefer-dist laravel/laravel blog

Step 2 - Set Mail Configuration You have to add your gmail smtp configuration, open your .env file and add your configration. .env

Step 3 - Create Mailable Class with Markdown

php artisan make:mail SendEmail --markdown=emails.mail


namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class SendEmail extends Mailable
    use Queueable, SerializesModels;

    public $maildata;

     * Create a new message instance.
     * @return void
    public function __construct($maildata)
        $this->maildata = $maildata;

     * Build the message.
     * @return $this
    public function build()
        $email = $this->markdown('emails.mail')->with('maildata', $this->maildata);

        $attachments = [
            // first attachment

            // second attachment

            // third attachment

        // $attachments is an array with file paths of attachments
        foreach ($attachments as $filePath) {

        return $email;

Step 4 - Add Route


use Illuminate\Support\Facades\Route;
use App\Http\Controllers\MailController;

Route::get('send-mail', [MailController::class, 'sendMail']);
Step 5 - Create Controller

php artisan make:controller MailController


namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Mail\SendEmail;
use Mail;

class MailController extends Controller
     * Show the application dashboard.
     * @return \Illuminate\Contracts\Support\Renderable
    public function sendMail()
        $email = 'xyz@gmail.com';
        $maildata = [
            'title' => 'Laravel Mail Attach Multiple Files',

        Mail::to($email)->send(new SendEmail($maildata));
        dd("Mail has been sent successfully");

Step 6 - Add View File


# {{ $maildata['title'] }}

Hello Dev.


{{ config('app.name') }}

You can run your project by using following command:

php artisan serve

Now open this url:




Leave a Reply

Your email address will not be published. Required fields are marked *