Laravel 5.6 Sending Emails using SMTP Tutorial

Laravel php Programming Technology

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.

List of all Google Adsense, VueJS, AngularJS, PHP, Laravel Examples.

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

<div>
<b>Welcome To Laravel 5.6 Sending Emails using SMTP Tutorial</b>
    Hi, This is : {{ $category }}
</div>

Step 5: Laravel 5.6 route to send an email.

routes >> web.php

Route::get('/send/email', '[email protected]');

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.


Related FAQ

Here are some more FAQ related to this Article:

  1.   PHP Array Remove specific value Example
  2.   Laravel Send Email Attachment Tutorial With Example
  3.   Internal server error with Laravel FIX
  4.   Send WhatsAPP Message API using PHP Step By Step
  5.   Laravel 5/6/7 Import & Export data to Excel CSV using maatwebsite
  6.   Simple Laravel Sending Emails Example
  7.   Number Filter using Angular Example
  8.   Form Data Binding using Angular Example
  9.   QueryException in laravel 6 Exception Handling
  10.   PHP Ternary shorthand If/Else Examples

Leave a Reply

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