SMTP
An SMTP timeout error is a TCP/socket-level failure where the connection stalls before the SMTP conversation finishes. Learn the real causes and how to fix it.
Updated Jul 1, 2026
The short answer
An SMTP timeout error means your client opened (or tried to open) a connection to the mail server but the SMTP conversation stalled before completing — it is a TCP/socket failure, not a numbered SMTP reply code. Usual causes are a blocked outbound port (commonly 25), a firewall, wrong host/port, or a slow/unresponsive server. Fix it by testing connectivity with telnet/openssl and switching to port 587 or 465.
An "SMTP timeout error" is not a standard SMTP reply code. There is no 3-digit SMTP code named "timeout." It is a transport-level (TCP/socket) failure: your client either couldn't open a connection to the mail server in time, or opened one but never received an expected response, so the library aborted. Libraries surface it under names like ETIMEDOUT / ESOCKET (Nodemailer), socket.timeout (an alias of TimeoutError since Python 3.10) in Python smtplib, or "Connection timed out." The one genuine SMTP reply in this area is server-side: 451 Timeout waiting for data from client (Amazon SES), returned when an idle client holds a connection open too long.
telnet email-smtp.us-east-1.amazonaws.com 587# or, for an implicit-TLS endpoint:openssl s_client -connect smtp.example.com:465 -crlf
A 220 greeting means the path is open and the problem is in your code/credentials. A hang or "Connection timed out" confirms a network/firewall/port block.
connectionTimeout 120000 ms, greetingTimeout 30000 ms, socketTimeout 600000 ms — increase them in the transport config:nodemailer.createTransport({host: "smtp.example.com",port: 587,connectionTimeout: 60000,greetingTimeout: 30000,socketTimeout: 300000,});
Tip: if you're hitting timeouts because your own outbound port is blocked, sending through an API-based provider (or Courier, which fans out to SES/SendGrid/etc. over HTTPS) sidesteps SMTP port restrictions entirely.
References
FAQ
No. There is no numbered SMTP reply code called "timeout." It is a TCP/socket-level failure where the connection stalls before the SMTP exchange completes, reported by client libraries as ETIMEDOUT, ESOCKET, or socket.timeout. The closest real SMTP reply is the server-side 451 'Timeout waiting for data from client.'
One API, every provider
Courier connects to your email, SMS, and push providers, handles retries and failover, and surfaces delivery errors in plain language.
Reply-code definitions per RFC 5321 §4.5.3.2. Last reviewed Jul 1, 2026. Courier is not affiliated with third-party providers; error behavior may vary by implementation.
© 2026 Courier. All rights reserved.