ihue ihue - 5 years ago 697
PHP Question

Connection could not be established with host smtp.gmail.com [Operation timed out #60]

I can't sent out any email in my local environment.

I keep getting :

enter image description here
_

.env file.



MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=my-email@gmail.com
MAIL_PASSWORD=*****





Note : Surprisingly - I have the same setting in my production server, and it works perfectly.

Any hints / suggestions ?

Answer Source

Update my driver line to

MAIL_DRIVER=sendmail

It works on the first try.

Final .env file should look like this

MAIL_DRIVER=sendmail
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=my-email@gmail.com
MAIL_PASSWORD=*****
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download