Mail sending laravel 7

Viewed 84

my env file is as below

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=support@company.com
MAIL_PASSWORD=kh=*****&***
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

Is this set up correct? I am getting response code "535" while expecting code 235.

5 Answers

This might help you.

Replace: MAIL_PASSWORD=yourpassword
With: MAIL_PASSWORD="yourpassword"

Also run the following command to clear cache.

php artisan optimize:clear

Above command is all in one.

enter image description here

Please add double quote "" in your email password & try

Like:

MAIL_PASSWORD=kh*****&***

TO

MAIL_PASSWORD="kh*****&***"

Whenever you do change in .env file Run "php artisan optimize:clear" It will clear your cache etc.

Try this code :

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=support@company.com
MAIL_PASSWORD="kh=*****&***"
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

And then run php artisan optimize:clear for clearing your laravel cache.

If still not working try these commands:

php artisan cache:clear
php artisan config:clear
php artisan route:clear

where is your code first? then programmer can find problem. If you dont want to show full code then you should restart serve php artisan serve as you have changed you .env file.

Related