Send Email through Laravel

 

Send Email through Laravel


  • First create a Laravel project
        composer create-project laravel/laravel send-email

  • Make configurations in the .env file

  • Create Mail
        php artisan make:mail MyTestMail

  • The mail file will create in the app/Mail/MyTestMail.php
  • Update the mail file as below


  • Create a blade file and add the content which you need to send through the email


  • Call the mail inside a controller
  • Create a controller and import following
        use App\Mail\MyTestMail;
        use Mail;

  • Call the mail and send it to the relevant user


  • Run the project


Comments

Post a Comment

Popular posts from this blog

Load balance with NGINX

First Step to Laravel