Skip to content
Advertisement

Laravel Homestead Swift Cannot send message without a sender address

I get this error with stock email settings in Laravel 5.1 Homestead when I try to send a password reset mail.

JavaScript

The address is filled in app/config/mail.php:

JavaScript

Advertisement

Answer

In your .env file you will need to set the email address and password of your email account. You also need to set the host and port of the mail server you are using.

JavaScript

Or make sure that everything is complete in your mail.php file (see note below).

JavaScript

Note: It’s better to use the .env file, as you most likely will have a different configuration in your production environment.

If everything is completed and it still doesn’t work, it might be caching. You can clear the config cache with this:

JavaScript

Also note:

  • Port 465 is for Gmail. If it does not work, you can use 25.
  • The mail.php file is located at /app/config/mail.php (as OP said).
  • The .env file is located at the root of your project.
  • Mailtrap.io is a service for testing SMTP. It does not really send emails.

As Viktorminator mentioned: Take into consideration creating app passwords and not using your usual pass for this needs. Link for creating passwords myaccount.google.com/apppasswords

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement