[solved] Laravel 7 Swift_TransportException Cannot send message without a sender address

If you are getting “Swift_TransportException Cannot send message without a sender address” while trying to send email notifications using the mailtrap email testing tool. Then please make sure you added right settings of the mailtrap login details inside the .env file

MAIL_USERNAME=[mailtrap username]
MAIL_PASSWORD=[mailtrap password]

Add from email address and encryption. Then you have to clear config using following commands

php artisan config:clear

The config:clear command is used to remove the configuration cache file created by the config:cache command. By default this command will delete the bootstrap/cache/config.php file

If you still get that error then clear cache using

php artisan cache:clear

Leave a Reply

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