Telnet gives terminal access to plaintext network services. You can use it to validate SMTP behavior quickly when debugging routing, connectivity, or command-sequence issues.

## Installing telnet

Telnet comes with most Linux and Mac systems. On Windows machines you must enable telnet in the control panel programs and features section.

![telnet](/assets/telnet.png)

## Connect to an SMTP server

Open a terminal and connect to an SMTP endpoint:

```
telnet mx.mailslurp.com 2525
```

Here we connect to a [MailSlurp](/api/) SMTP endpoint. Replace host and port with your own provider values.

Common ports:

- `25`: legacy relay (often blocked on cloud hosts)
- `587`: submission with STARTTLS
- `465`: implicit TLS (not suitable for plain telnet)
- `2525`: alternate SMTP endpoint on some providers

If you are unsure which port to use, see [SMTP ports explained](/guides/what-are-smtp-ports/).

## Send e-mail via telnet: SMTP session example

After connecting, run commands in this order:

```
EHLO example.local
MAIL FROM:<sender@example.com>
RCPT TO:<recipient@example.net>
DATA
Subject: Telnet SMTP test
From: sender@example.com
To: recipient@example.net

This is a test email sent via telnet.
.
QUIT
```

Important details:

- `EHLO` starts an extended SMTP session and returns server capabilities.
- `MAIL FROM` and `RCPT TO` must use mailbox syntax with angle brackets.
- `DATA` starts message content mode; end with a single dot (`.`) on its own line.
- Include at least `Subject`, `From`, and `To` headers for readability.

## Why telnet sometimes fails on production SMTP

Many production SMTP providers require encryption and authentication before mail submission.

If your server requires STARTTLS or AUTH, plain telnet will not complete the full flow. Use:

- `openssl s_client -starttls smtp -connect host:587` for encrypted testing
- application clients (Nodemailer, JavaMail, SMTP libraries) for auth-enabled send paths

## What about receiving email?

SMTP is for sending. To retrieve messages, use POP3 or IMAP (different protocols and commands).

For inbox retrieval and test assertions, use:

- [SMTP and IMAP guide](/guides/smtp-imap/)
- [Email integration testing](/product/email-integration-testing/)
- [Email Sandbox](/product/email-sandbox/)

## BCC and CC

For more options see the [BCC and CC SMTP guide](/guides/bcc-and-cc-in-smtp-emails/).

## Production next steps after telnet testing

Telnet is useful for protocol debugging, but production workflows need additional safety checks:

- Validate long-term server setup with [SMTP and IMAP settings](/guides/smtp-imap/).
- Confirm encryption choices using [STARTTLS vs SSL vs TLS](/blog/starttls-ssl-tls/).
- Add a full [email deliverability test](/testing/email-deliverability-test/) before scaling traffic.
- Use [Email Sandbox](/product/email-sandbox/) for repeatable CI and staging validation.



{{LANDING_SHORTCODE:POST_CTA_BANNER:%7B%22title%22%3A%22Preview%20the%20message%20after%20SMTP%20accepts%20it%22%2C%22content%22%3A%22After%20Telnet%20confirms%20the%20SMTP%20command%20path%2C%20run%20%5BFree%20Email%20Render%5D(%2Ftools%2Ffree-email-render%2F)%20or%20device%20previews%20to%20review%20the%20delivered%20HTML%2C%20buttons%2C%20images%2C%20responsive%20layout%2C%20and%20dark-mode%20contrast.%22%2C%22buttonHref%22%3A%22%2Fproduct%2Fdevice-previews%2F%22%2C%22buttonText%22%3A%22Explore%20device%20previews%22%2C%22buttonTheme%22%3A%22blue%22%2C%22image%22%3A%22%2Fassets%2Fhome%2Fdevice-render-devices.png%22%2C%22imageAlt%22%3A%22Email%20preview%20workflow%20after%20SMTP%20command%20testing%22%2C%22imageWidth%22%3A%22800%22%2C%22imageHeight%22%3A%22415%22%2C%22imagePosition%22%3A%22%22%7D}}



## Wrapping up

Telnet can help you interact directly with an SMTP server, send a test email, specify sender and recipient addresses, and inspect the protocol flow in real time.

MailSlurp also supports [email tracking](/guides/email-tracking-pixels/), [inbox automation](/product/email-proxy-forwarding-routing-rules/), and [email address APIs](/product/email-address-api/) for teams that need repeatable email testing and automation beyond manual SMTP debugging.
