After configuring SMTP sometime we need to test if it works or not without sending a real email. There’s a solution for that.
- First, go to the Laravel app directory and then open tinker by running this command: php artisan tinker.
- After that, you can enter this command:
Mail::raw('Testing Email', function ($message){ $message->to('[email protected]')->subject('Test Email'); });
Don’t forget to replace [email protected] with your active email. If the configuration is correct then an email will be sent to your inbox: