your mail.php
on config you declare host as smtp.mailgun.org
and port is 587
while on env is different. you need to change your mail.php
to
'host' => env('MAIL_HOST', 'mailtrap.io'),
'port' => env('MAIL_PORT', 2525),
if you desire to use mailtrap.Then run
php artisan config:cache
I believe this has been answered in some sections already, just test with gmail for your "MAIL_HOST" instead and don't forget to clear cache. Setup like below: Firstly, you need to setup 2 step verification here google security. An App Password link will appear and you can get your App Password to insert into below "MAIL_PASSWORD". More info on getting App Password here
MAIL_DRIVER=smtp
[email protected]
MAIL_FROM_NAME=DomainName
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=YOUR_GMAIL_CREATED_APP_PASSWORD
MAIL_ENCRYPTION=tls
Clear cache with:
php artisan config:cache
I see you have all the settings right. You just need to end the local web server and start it again with
php artisan serve
Everytime you change your .env
file, you need tor restart the server for the new options to take effect.
Or clear and cache your configuration with
php artisan config:cache
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With