Jo Micheal
Published in : 2022-01-20
Swift_TransportExceptionConnection could not be established with host smtp.gmail.com :stream_socket_client(): Unable to connect to tcp://smtp.gmail.com:587 (Network is unreachable)
I am trying to use SMTP from Gmail with my laravel app but it didn't work when I switched to the live server I am getting this error
What should I do? here is the .env config which I am uisng
MAIL_MAILER=smtpMAIL_HOST=smtp.gmail.comMAIL_PORT=587MAIL_USERNAME={my_email}@gmail.comMAIL_PASSWORD="PASSWORD"MAIL_FROM_NAME="Website"MAIL_FROM_ADDRESS={my_email}@gmail.comMAIL_ENCRYPTION=tls
I tried to change the port to 443 and also i changed tsl to ssl & nothing happen the same error
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now
Joseph Morgan Date : 2022-01-20
Best answers
11
Best answers
11
This config working for me when I am using Server supports HTTPS & SSL when I used a server without SSL (HTTP) it doesn't work until I switched the smtp with "sendmail”
so your configuration should looks like
Good luck
Jo Micheal Date : 2022-01-20
Wow, this works for me, never heard of sendmail thank you so much