Issue
I am using Laravel 5.1 I made a contact page in my application. So users can send an email. Here I have used mailtrap.io It works when I have created. I mean there was no problem to send mail to mailtrap.io
But today, when I was checking this again, It shows me this error.
Swift_TransportException in StreamBuffer.php line 268: Connection could not be established with host mailtrap.io [A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. #10060]
I have checked my .env file with mailtrap.io setting. everything is ok. Here is my .env file setting
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=25
MAIL_USERNAME=[username]
MAIL_PASSWORD=[password]
MAIL_ENCRYPTION=tls
Anyone please help me?
Solution
Probably you have issues with port 25 being blocked by your provider or host.
You can verify this using telnet:
telnet smtp.mailtrap.io 25
If you get no response or a timeout, you can not use port 25.
Mailtrap allows you to use 2 other ports, 2525 and 465.
You can verify with telnet if those ports are working.
telnet smtp.mailtrap.io 2525
If that connects properly, modify your .env file to use 2525.
If you are using php artisan serve
instead of homestead or something else, be sure to restart after making changes to your .env.
Answered By - Robert
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.