I got stack on this error I trying to configure SMTP mail on laravel
here is my configuration on .env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=fff3c01db52ee0
MAIL_PASSWORD=feaeda91dc9ab6
MAIL_ENCRYPTION=TLS
I have try to authenticate the SMTP on env but I keep get the same error so for now am stack on that error
That is basically authentication error due to misconfiguration of email settings.
Go to
.env
filechange
to
The MAIL_USERNAME and PASSWORD should be replaced with your Gmail Email address and Password respectively. Login to your Google Account, Go to security settings and enable Allow Less Secure App switch button.
After that go to your project root directory and run the following command:
. Please refer to
this guide for assistance and clarification (Note: For MAIL_HOST use smtp.gmail.com)
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
Clear cache with:
Yep, and if you have tried all the above solutions (what's more likely to happen) and none work for you, it may happen that Guzzle is not installed.
Laravel ships mailing tools, by which is required the Guzzle framework, but it won't be installed, and AS OF the documentation, will have to install it manually: https://laravel.com/docs/master/mail#driver-prerequisites
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
I see you have all the settings right. You just need to end the local web server and start it again with
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