Today, I will give you an example of “How to fix Swift_TransportException Cannot send a message without a sender address in Laravel”. So you can easily apply it with your laravel applications.
Swift_TransportException in Laravel
This is a common error in laravel application, the Swift_TransportException through this error while we send a mail and perform an action in laravel application.
This error is basically seen in our application when we not define the “MAIL_FROM_ADDRESS” in the .env file.
Let’s fix this error
MAIL_FROM_ADDRESS=contact@gmail.com
Just add a MAIL_FROM_ADDRESS by default it is NULL in .env file.
If everything is completed and it still not working, it might be caching issue. You can clear the config cache with this.
php artisan config:cache
In this article, we successfully fixed “Swift_TransportException Cannot send a message without a sender address in Laravel”, I hope this article will help you with your Laravel application Project.