PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, March 11, 2022

[FIXED] sending mail to mailtrap.io

 March 11, 2022     email, laravel-5     No comments   

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
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing