How to test sending Laravel email from command prompt

If you want to test if you can send email from Laravel using only command prompt, here is how ..

  • First open your favorite command prompt
  • Go to your root folder of your website (i.e cd c:\xampp\htdocs\mySite )
  • Run this command: php artisan tinker
  • Mail::send(‘myView‘, [], function ($message) { $message->to(‘yourEmail@test.com’)->subject(‘Sending mail is OK’); });

Leave a Reply

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