Published:


Laravel Permalink

Testing email functionality using tinker

Email functionality is a crucial aspect of many web applications, including those built with Laravel. Being able to send emails reliably is essential for user notifications, password resets, and various other communication purposes. In this tutorial, we will walk through the steps to test if your Laravel application is properly configured to send emails via the CLI (tinker). By following this guide, you can ensure that your application’s email functionality is working correctly.

To send emails, you need to configure the email settings in your Laravel application. Open the .env file located in the root directory of your Laravel project. Ensure that the email configuration variables are set correctly. You’ll need to provide the SMTP server details, such as the host, port, username, password, and any additional configuration required by your email service provider. Update the following variables in the .env file.

Open a terminal or command prompt and navigate to your Laravel application’s root directory. Run the following command to trigger the test email:

php artisan tinker
Mail::raw('Hello World!', function($msg) {$msg->to('your-email@com')->subject('Testing Email'); });

proxy

hasValidSignature no laravel aplicação atrá do proxy

app/Http/Middleware/TrustProxies.php

protected $proxies = '*';