Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connection could not be established with host smtp.mailtrap.io [Connection timed out #110] with right env

I am using mail trap to test my emails and I am getting the error stated in above in the title.

This is the env files that I have

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=465
MAIL_USERNAME=XXXXXddda513d4
MAIL_PASSWORD=da084XXXXXXbbe
MAIL_ENCRYPTION=tls

I can not find much on this. What I found was to clear your cache and I did it wand saw no change.

like image 482
John Freedom Avatar asked Feb 07 '18 01:02

John Freedom


Video Answer


2 Answers

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=587
MAIL_USERNAME=*******
MAIL_PASSWORD=********
[email protected]
MAIL_FROM_NAME=Example

switch the MAIL_PORT between (25 or 465 or 587 or 2525)

like image 84
icharis Avatar answered Oct 22 '22 17:10

icharis


use port 25 and mail encryption is empty like

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=25
MAIL_USERNAME=XXXXXddda513d4
MAIL_PASSWORD=da084XXXXXXbbe
MAIL_ENCRYPTION=
like image 4
Sathishkumar Manoharan Avatar answered Oct 22 '22 19:10

Sathishkumar Manoharan