📧 SMTP Tester
Look up a domain's mail servers, then get ready-to-run connection test commands for ports 25, 587 and 465 — the exact commands you need since browsers can't open a live SMTP connection themselves.
Why This Tool Doesn't (and Can't) Show a Live Connection Result
It's worth being upfront about this rather than pretending otherwise: every modern web browser maintains a list of "restricted ports" that JavaScript running on any web page — including this one — is simply not allowed to connect to, and every standard mail port is on that list. Ports 25, 465, 587, 110, 143, 993 and 995 are all blocked at the browser level specifically because unrestricted access to mail ports from arbitrary web pages would make browsers a convenient tool for spam relay and mail server probing. This isn't a limitation specific to this tool or this site — no browser-based tool, from any vendor, can open a genuine SMTP connection from client-side JavaScript, full stop.
What this tool does instead is the next most useful thing: it looks up your domain's actual MX records via DNS (a query type browsers are allowed to make), and generates the precise, correct command for the operating system and tool you actually have available, so you can run a real, live connection test yourself in a matter of seconds. This is also simply a more honest approach than tools that quietly fake a "connection successful" result using an unrelated technique that doesn't actually test SMTP at all, and it's an approach consistent with how the rest of this site handles diagnostics that genuinely can't be performed safely from inside a browser sandbox.
Understanding the Three Main SMTP Ports
| Port | Name | Encryption Model | Typical Use |
|---|---|---|---|
| 25 | SMTP | Plain text, optionally upgraded via STARTTLS | Server-to-server mail relay; frequently blocked outbound by ISPs and cloud providers |
| 587 | Submission | Plain connection, upgraded via STARTTLS | Authenticated client sending mail through a provider |
| 465 | SMTPS | Implicit TLS from the first byte | Authenticated client sending mail, older standard now back in common use |
A server can legitimately listen on all three, some, or just one — there's no universal rule, and a domain that only accepts port 587 for client submission while blocking direct port 25 access from arbitrary hosts (a common, deliberate anti-abuse configuration) is behaving correctly, not incorrectly.
How MX Lookup Fits Into SMTP Testing
Before testing any connection, you need to know which host to actually test against, and that's exactly what an MX (Mail Exchange) DNS record tells you — it maps a domain to the hostname(s) responsible for accepting mail on its behalf, each with a priority number where lower numbers are tried first. This tool queries MX records automatically when you enter a domain, sorts them by priority, and lets you generate test commands against whichever mail server you want to check, without you needing to separately run a DNS lookup first. If a domain has no MX record at all, some mail systems fall back to the domain's own A record as an implicit mail server, though this is increasingly rare and generally considered a misconfiguration for anything beyond very small, informal setups.
Reading the Generated Commands
| Tool | Platform | Best For |
|---|---|---|
| telnet | macOS, Linux (may need separate install) | Quick plain-text SMTP conversation testing on port 25 or STARTTLS-capable port 587 |
| openssl s_client | macOS, Linux, Windows (with OpenSSL installed) | Testing TLS-wrapped connections directly, including port 465 and STARTTLS on 587/25 |
| Test-NetConnection | Windows PowerShell | Quick reachability check without needing to interpret SMTP protocol responses |
| swaks | macOS, Linux (separate install) | Full authenticated send tests including STARTTLS negotiation and login, closest to a real mail client |
Interpreting Common Results
| What You See | What It Means |
|---|---|
| A 220 greeting line appears immediately after connecting | The server is reachable and SMTP service is running correctly — this is the expected healthy response |
| Connection hangs with no output at all | Likely a firewall silently dropping packets (a timeout scenario), rather than the server actively refusing |
| "Connection refused" appears immediately | Nothing is listening on that port at that host, or a firewall is actively rejecting rather than silently dropping |
| Connects but disconnects after a few seconds with no data | Possible greeting delay/tarpit anti-spam technique, or an IP reputation-based rejection happening before the banner is sent |
| TLS handshake fails specifically on port 465 | Server may not support implicit TLS on that port, or an outdated TLS version is being negotiated — check server-side TLS configuration |
Step-by-Step: Diagnosing a Failed SMTP Connection
Start by confirming the MX record itself resolves to the host you expect — a surprising number of "the mail server won't connect" reports turn out to be an MX record pointing at a stale or incorrect hostname, catchable in seconds with the lookup this tool performs automatically. Next, generate and run the test-connection command for the specific port you're troubleshooting rather than assuming a general internet connectivity problem, since port-specific blocking is extremely common and a working port 587 alongside a blocked port 25 is normal, not broken. If the connection times out rather than being actively refused, suspect a firewall along the path silently dropping the traffic — check both the destination server's own firewall and any network-level blocking upstream (your ISP, cloud provider, or corporate network). If the connection succeeds but the server closes it unexpectedly, check the mail server's own logs directly, since the reason (rate limiting, IP reputation, missing authentication) is almost always visible there even when invisible from the client side.
Common Real-World Scenarios
| Scenario | Likely Explanation |
|---|---|
| Port 25 blocked, port 587 works fine | Expected — most consumer ISPs and many cloud platforms block outbound 25 by default while leaving 587 open for legitimate submission |
| Works from office network, fails from home | Different networks apply different outbound port policies; this is a network-level difference, not a server problem |
| Worked yesterday, fails today with no changes made | Check for IP reputation/blacklist changes, a recent firewall rule update, or the mail provider's own service status |
| Connects on 465 but authentication fails afterward | Connection-level success confirms network reachability; authentication failure is a separate, application-layer issue unrelated to the port test itself |
Pros and Cons of Command-Line SMTP Testing
- Genuine, real-time result — not a simulation or heuristic guess
- Reveals the actual protocol conversation, not just a pass/fail
- Works identically regardless of which website generated the command
- No dependency on any third-party service continuing to work
- Requires terminal access and comfort with command-line tools
- Results depend entirely on the network you're testing from
- Some tools (swaks, openssl) may need separate installation
- Doesn't test message delivery, only connection-level reachability
Security Considerations
Running an SMTP connection test against a mail server you don't operate should be limited to standard, non-intrusive diagnostic queries — checking connectivity and reading the greeting banner is generally considered acceptable diagnostic behavior, the same as a basic ping or traceroute, but repeated automated probing, authentication brute-forcing, or attempting to relay mail through a server you don't have permission to use crosses into behavior that can trigger abuse detection or worse. Treat any mail server you're testing that isn't your own the same way you'd treat any other system you don't administer — read-only, minimal, and respectful of what a reasonable network operator would consider a legitimate diagnostic check.
Reading an Actual SMTP Conversation
Once you run one of the generated commands and get a live response, it helps to know roughly what a healthy conversation looks like so you can tell a working server apart from one that's merely reachable but broken. A successful plain connection on port 25 typically starts with a line like 220 mail.example.com ESMTP ready the instant the TCP connection completes — that 220 code is the server announcing itself and inviting a conversation. From there, issuing EHLO yourhost should return a list of supported extensions (STARTTLS, AUTH mechanisms, size limits) prefixed with 250. If STARTTLS is offered and you issue it, a properly negotiating server upgrades the connection to TLS silently from that point forward. Seeing the 220 banner alone, even without going further, already confirms the most important fact: the server process is running and listening, which is often the entire question a connectivity test is trying to answer.
Why the Generated Commands Differ by Platform
macOS and most Linux distributions ship with core networking utilities that make ad hoc protocol testing straightforward, though telnet specifically has been removed from newer macOS versions by default and may need a quick install via a package manager. Windows doesn't traditionally include telnet enabled by default either, which is why the PowerShell-based Test-NetConnection command is offered as the more broadly available option there — it doesn't show you the actual SMTP conversation, but it reliably confirms whether the TCP port itself is open and reachable, which is frequently the exact question being asked. For anyone wanting the fullest picture regardless of platform, installing openssl (widely available as a standalone binary or through common package managers on all three major operating systems) gives the most consistent, capable testing experience across the board.
Expert Tips for More Reliable Testing
SMTP Testing in a Broader Email Deliverability Workflow
Connection-level testing is genuinely just the first, most basic layer of a much larger deliverability picture, and it's worth being clear about where it fits so expectations stay realistic. A passing connection test confirms the network path and the mail service itself are working — nothing more. It says nothing about whether SPF, DKIM and DMARC are correctly configured for the sending domain, nothing about the sending IP's reputation with major mailbox providers, and nothing about whether content-based spam filtering will flag a specific message. Teams troubleshooting "my email isn't arriving" issues should treat a successful SMTP connection test as ruling out one specific class of problem (network/server reachability) while still needing to separately verify authentication records with tools like SPF Lookup, DKIM Lookup and DMARC Lookup, since a perfectly reachable server can still fail to deliver mail for entirely separate reasons that a connection test was never designed to catch in the first place.
Real-World Use Cases
When the MX Lookup Itself Returns Nothing
Occasionally the lookup step itself comes back empty, which is a distinct problem from a connection test failing and deserves its own quick diagnosis. No MX records at all typically means either the domain genuinely has no mail configured (common for domains used purely for web hosting with no associated email), or a very recent DNS change hasn't propagated yet. Before assuming a connectivity problem downstream, confirm the domain actually has MX records published at all using this tool's lookup step, since testing connection commands against a host that was never actually configured as a mail server will understandably fail regardless of network conditions, and the fix there is publishing correct MX records rather than chasing a network issue that doesn't exist.
Related Reading
For a deep dive on the authentication step that happens after a successful connection, see SMTP Authentication. For a full breakdown of every port and when to use which, read SMTP Ports Explained. For the TLS/SSL distinction referenced throughout this page, see SMTP TLS vs SSL. For relay-specific configuration and errors, read SMTP Relay. If your connection is failing and you need a broader systematic troubleshooting process, see SMTP Troubleshooting and SMTP Connection Errors.