Home » Laravel 5.6 Sending Emails using SMTP Tutorial

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.

Read Also:  Get Responsive navbar menu to Automatically close after anchor link clicked

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

Read Also:  Simple Laravel Sending Emails Example

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 :

Read Also:  Laravel Send Email Attachment Tutorial With Example

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. Read Also:  VueJS onload Function Call Example with Demo
  2. Read Also:  PHP Timestamp Date Time format Function
  3. Read Also:  codeigniter Controller pass parameter route Function
  4. Read Also:  Facebook Api Get User Id Profile Information using PHP
  5. Read Also:  Laravel Insert Update Delete in Eloquent ORM laravel
  6. Read Also:  Angular 6 AJAX Tutorial Example From Scratch
  7. Read Also:  Advanced Recursive paths with React Router
  8. Read Also:  Asp.Net Clear all controls value reset
  9. Read Also:  Laravel 6 Bootstrap Toggle Switch With Ajax Update To Mysql
  10. Read Also:  Laravel 6 Bootstrap Toggle Switch With Ajax Update To Mysql

Leave a Comment

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