Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
[email protected]
MAIL_PASSWORD=*****

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

Any hints / suggestions ?

like image 357
code-8 Avatar asked Jun 03 '15 15:06

code-8


People also ask

Could not connect to IMAP Gmail Com Network is unreachable?

"Network is unreachable" suggests that the server name is wrong or that the DNS service is returning the wrong address. (imap.gmail.com and port 993 are correct. Make sure your software is using SSL to connect.)


1 Answers

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
[email protected]
MAIL_PASSWORD=*****
like image 121
code-8 Avatar answered Oct 09 '22 23:10

code-8