First try to clear you config, php artisan config:clear
And make sure you're using the correct port for the smtp connection.
Apr 8, 2024
3
Level 8
Connection could not be established with host when trying to send mail using SMTP
Hi,
I am trying to send mails using the test SMTP of the company. In the test server - it works and mails are sent. On the local PC, it fails with the following:
Unable to connect to smtp.company.com:20 (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)
The config and .env are the same for both the test server and my local development PC, and when I try to ping using ping smtp.company.com I do get replies so it seems like it's working?
Local is XAMPP - could that be related to that as well?
Thanks
Level 122
Speak to your network admins, there may be firewall rules in place on the mail server that limits who can connect to it.
1 like
Please or to participate in this conversation.