SMTP outbound connections timing out on Railway Hobby plan
madarom
HOBBYOP

a month ago

I'm experiencing an issue with outbound SMTP connections on my Laravel application hosted on Railway.

Project details:

  • Framework: Laravel 10
  • Plan: Hobby
  • Environment: Production

I am trying to send emails using Laravel's Mail facade.

I tested multiple SMTP providers:

  • Gmail SMTP (smtp.gmail.com)

    • Port 587 (TLS)
    • Port 465 (SSL)
  • Brevo SMTP (smtp-relay.brevo.com)

    • Port 587
    • Port 465
    • Port 2525
    • Port 25

From the Railway shell, I executed:

fsockopen("smtp.gmail.com", 587);
fsockopen("smtp.gmail.com", 465);
fsockopen("smtp-relay.brevo.com", 587);
fsockopen("smtp-relay.brevo.com", 465);
fsockopen("smtp-relay.brevo.com", 2525);
fsockopen("smtp-relay.brevo.com", 25);

All of these return:

Connection timed out

Laravel also reports:

Connection could not be established with host "...":
stream_socket_client(): Unable to connect (... Connection timed out)

Since the timeout occurs before SMTP authentication, it appears that outbound SMTP connections cannot be established from my Railway environment.

Could you please confirm:

  1. Are outbound SMTP connections allowed on the Hobby plan?
  2. Is there any firewall or networking restriction affecting ports 25, 465, 587, or 2525?
  3. Is there any additional configuration required to enable outbound SMTP connections?

Thank you for your assistance.

Best regards,

1 Replies

a month ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...