Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Lars-Janssen's avatar

Emai smtp l settings sendgrid not working?

Hi,

I'm using sendgrid for sending my emails with smtp. My .env settings look like this:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=465
MAIL_USERNAME=apikey
MAIL_PASSWORD=SG.e2_5lCFhRn.............
MAIL_ENCRYPTION=ssl
MAIL_FROM_NAME="Myname
[email protected]

Local this is working but on my production server I keep getting:

Connection could not be established with host smtp.sendgrid.net [Connection timed out #110]

I already tried everything changing ports, from ssl to tls but nothing works :(

What could be wrong here?

Thx!

0 likes
3 replies
Cronix's avatar
Cronix
Best Answer
Level 67

Drop that error message into google. I think the most common reason has to do with your ports/firewall on the server. Can you ssh in and telnet into sendgrid, or ping it?

Cronix's avatar

Often hosts will only have 2 email ports open (25 and something else for ssl) and block everything else for security. You don't want everything wide open. That's why sendgrid and others allow connecting from different ports in case hosting companies are blocking one. Whoever you're hosting with probably which port(s) to use documented somewhere.

Please or to participate in this conversation.