Laravel 5.6 Sending Emails using SMTP Tutorial

Today, We want to share with you Laravel 5.6 Sending Emails using SMTP Tutorial.In this post we will show you Send Email In Laravel 5.6, hear for How To Send Email In Laravel Tutorial we will give you demo and example for implement.In this post, we will learn about PHP Laravel 5.6 – Send Email using Mail Example with an example.

Laravel 5.6 Sending Emails using SMTP Tutorial

There are the Following The simple About Laravel 5.6 Sending Emails using SMTP Tutorial Full Information With Example and source code.

As I will cover this Post with live Working example to develop laravel 5.6 send mail gmail, so the some major files and laravel 5.6 mail send example for this Send email in Laravel 5.6 email sending services is following below.

  • Simple Install Laravel 5.6
  • Email Settings >> .env
  • Laravel 5.6 Mailable class
  • view file Laravel 5.6
  • Include Route

Send Email In Laravel 5.6

Step 1: Install Laravel 5.6 Project

simple downloading xampp or wampp your server installing Laravel Project

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

Step 2: Email Settings.

Laravel 5.6 the .env file

Host:	smtp.mailtrap.io
Port:	2525
Username:2sdf5dfds2fd5f	// some username
Password:sdf4f5d5f5d4fd	// some password
Auth:	PLAIN, LOGIN and CRAM-MD5
TLS:	Optional

Free Get Email mailtrap : User name and password

Step 3: Make Mailable class.

Go to Terminal >> run this commands

php artisan make:mail SendMailable

App\Mail\SendMailable.php

category = $category;
    }

    public function build()
    {
        return $this->view('emails.category');
    }
}

Step 4: Make a view Laravel file.

category.blade.php

Welcome To Laravel 5.6 Sending Emails using SMTP Tutorial Hi, This is : {{ $category }}

Step 5: Laravel 5.6 route to send an email.

routes >> web.php

Route::get('/send/email', 'CategoryController@mail');

CategoryController.php

// CategoryController.php

use Illuminate\Support\Facades\Mail;
use App\Mail\SendMailable;

public function mail()
{
   $category = 'Jaydeep';
   Mail::to('[email protected]')->send(new SendMailable($category));
   
   return 'Your Email was sent successfully';
}

Step 6: Run the Project.

php artisan serve
Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about PHP Laravel 5.6 – Send Email using Mail Example.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment