Errors

SMTP connection timed out: why it happens and how to fix it

Short answer

"Connection timed out" when sending email means your app never got an answer from the SMTP server, so no SMTP code was exchanged at all. On Windows it shows as socket error 10060. The usual cause is a blocked port: cloud providers such as AWS and Google Cloud block outbound port 25, and networks and firewalls block others. Use port 587 or 465 to a relay, check the hostname, and test with a direct connection.

Last checked 16 November 2026

SMTP connection timed out means your app or server tried to open a connection to a mail server and never got an answer. Nothing was rejected, because no SMTP conversation happened. In almost every case, something between you and the server is dropping the connection, most often a blocked port.

The error message

There is no SMTP code. You see a network error from your language or operating system, for example:

Connection timed out
connect ETIMEDOUT 203.0.113.10:25
Socket error 10060: Connection timed out

Microsoft’s Windows Sockets error list defines 10060 (WSAETIMEDOUT): “A connection attempt failed because the connected party did not properly respond after a period of time, or the established connection failed because the connected host has failed to respond.”

What it means

To send mail, your client opens a TCP connection to the server’s port, then waits for a 220 greeting. A timeout means one of those steps never completed:

Where it stops Usual reason
Before the connection opens A firewall or provider drops packets to that port, or the host is wrong.
After connecting, before the greeting Port and encryption mismatch, or a server that is overloaded.
Mid-session A slow network, or a filter that holds the connection.

Why it happens

  • Outbound port 25 is blocked. AWS EC2 allows port 25 only to private IPv4 addresses by default and blocks it to public IPv4 and IPv6 addresses. Google Cloud blocks connections to port 25 on external destinations in most projects. Many home ISPs do the same.
  • A firewall blocks 587 or 465 on a company network, hosting plan or container platform.
  • Wrong hostname or IP, such as an old server name or a typo.
  • Port and encryption mismatch. Plain SMTP to port 465 waits for a greeting that never arrives, because the server expects TLS first.
  • The server is down or rate limiting new connections.
  • IPv6 trouble: your system tries IPv6 first and the route does not work.

How to fix it

  1. Use a submission port. Send to a relay on 587 (STARTTLS) or 465 (TLS from the start), not port 25. See SMTP ports.
  2. Test the connection directly:
    nc -vz smtp.example.com 587
    openssl s_client -connect smtp.example.com:465 -quiet
    openssl s_client -starttls smtp -connect smtp.example.com:587 -quiet
    If nc hangs, the port is blocked or the host is wrong. If it connects, check your app’s settings.
  3. Match port and encryption. 465 needs implicit TLS (secure: true in Nodemailer, SMTP_SSL in Python). 587 needs plain connect then STARTTLS. Mixing them causes timeouts or wrong version number errors.
  4. Open the firewall for outbound 587 or 465 on your server, security group or network.
  5. On cloud servers, request removal of the port 25 restriction from your provider, or more simply send through a relay on 587.
  6. Increase the timeout only after the above. A longer timeout does not help a blocked port.
  7. Try IPv4 if the hostname resolves to IPv6 and IPv6 is not routed.

Which server sent it

None did. A timeout happens before any mail server replies, so it is not from Gmail, Microsoft or Yahoo. If you see a provider’s name in the error, it is the server you were trying to reach. Compare: a reply such as 421 Service not available means the server did answer.

Is it temporary?

Sometimes. A brief network problem clears on retry, and mail servers retry queued messages automatically. A blocked port never clears on its own: every attempt times out until you change port, network or firewall. If your app sends directly, add a retry with a delay and log the error.

How Mailcandor handles it

Mailcandor’s SMTP relay listens on smtp.mailcandor.com port 587 (STARTTLS) and 465 (TLS), so you avoid blocked port 25. If SMTP is blocked entirely, the email API sends over HTTPS on port 443. Delivery problems after that are explained in plain English by the deliverability coach, and hard bounces are suppressed automatically. Look up SMTP codes with the free bounce code lookup, or browse all error codes. More free checks are on the tools page. To make sure your own domain is authenticated, follow the SPF, DKIM and DMARC setup guide.

Questions

What does socket error 10060 connection timed out mean?

It is the Windows Sockets error WSAETIMEDOUT: the server did not respond in time, or an established connection stopped responding. For email it usually means a firewall dropped the SMTP connection.

Why does port 25 time out on my cloud server?

Many cloud providers block outbound port 25. AWS EC2 blocks it to public addresses by default, and Google Cloud blocks it to external destinations in most projects. Use port 587 or 465 to an SMTP relay.

What does "timeout after initial connection" mean?

The TCP connection opened but the server's greeting never arrived, or TLS never started. Often it is a port and encryption mismatch, such as plain SMTP to port 465.

Is a connection timeout a bounce?

No. The email never reached any server, so there is no bounce. Your app or mail server records the failure, and a mail server will retry.

Related

Send with someone on your side.

Unlimited domains on every plan, a person before any block, and 3,000 emails a month free. Tell us what you send and we set you up within one business day.