Skip to main content

How to Check an SMTP Connection with a Manual Telnet Session. Test email delivery by telnetting into an SMTP server. This simple check helps diagnose basic email issues quickly and efficiently.

How to Check an SMTP Connection with a Manual Telnet Session

Key Takeaways

  • Manual telnet testing is a quick, low-tech way to diagnose SMTP connectivity and configuration issues.
  • Use it to verify whether an SMTP server is reachable, properly configured, and accepting connections.
  • The test can reveal blocked ports, relay restrictions, DNS errors, or TLS compatibility issues.
  • Essential SMTP commands include EHLO/HELO, MAIL FROM, RCPT TO, DATA, and QUIT.
  • Port 25 is standard for relay, while 465 and 587 are used for secure submission.
  • Base64-encoded authentication (AUTH LOGIN) is required when servers demand login credentials.
  • Tools like Swaks or integrated email-testing platforms can automate and expand on telnet’s diagnostic steps.

Q&A Highlights

  • Why use telnet instead of a dedicated email testing tool?Telnet gives you direct visibility into the raw SMTP dialogue. It’s invaluable for troubleshooting at the protocol level and confirming server responses without third-party layers.
  • What’s the quickest way to tell if my SMTP port is blocked?Run telnet mail.example.com 25. If you get "Connection refused," your ISP or host is likely blocking the port.
  • Do I need to authenticate when testing with telnet?Only if the mail server requires authentication. Use the AUTH LOGIN command and send your username and password encoded in Base64.
  • Can I send a full email through telnet?Yes. After DATA, add your headers and body, end with a single period (.) on its own line, and then type QUIT.
  • Is telnet secure for SMTP testing?No. Telnet transmits data in plain text. Use it only for testing in safe, controlled environments. For secure connections, test over TLS using tools that support STARTTLS.

In the world of email, there are many facets to testing, but one of the most basic tests you can do is to simply telnet into a given SMTP server. This SMTP check is useful in determining if the most basic of problems do or do not exist.

  • Is the server up?
  • Is there a firewall blocking communication?
  • Does the mail server allow for relaying of a particular domain/email address?
  • What SMTP commands does the mail server support?
  • Does the server respond with the correct hostname?
  • Does the connection work outside any third-party software or APIs?

All these questions and more can be answered with a simple telnet test.

Before we get started, be sure to open up our companion piece to this post: To Where are Bounce Messages Sent? in a new tab so you can read it after you’re done with this blog.

As a note, the commands used in the following examples (as well as additional commands) are covered in section 4.1 ofRFC 2821.

How Do I Send an Email Using Telnet?

Sending email through telnet can help you identify deliverability problems within your current configuration.

Before you send an email using telnet, confirm telnet is both installed and enabled on your computer. Most computers come pre-installed with a telnet client. For those Windows versions that do not, one can be installed by opening the "Programs and Features" section of the control panel and selecting "Turn Windows features on or off". With this window open, select "telnet client" and then click OK.

Once a telnet client has been verified to be installed on the server, open the terminal window where you’ll enter your prompt commands. On Windows, use the Windows + R, key in "cmd", and press enter. For Mac users, you’ll find the terminal icon by opening Finder and searching for "Utilities" on the Applications page, or by entering "terminal" in the Launchpad search function.

Next, we need to find a mail server to log into. For this, we will need the DNS MX record for a given domain. This can be found with the following command (for these examples port25.com will be used, but any domain can be substituted):

Windows:

nslookup -type=mx port25.com Non-authoritative answer: port25.com MX preference = 100, mail exchanger = mail.port25.com

Linux:

nslookup -type=mx port25.com Non-authoritative answer: port25.com mail exchanger = 100 mail.port25.com

How Do I Test SMTP Using Telnet Authentication?

Now that you know how to check an SMTP connection with telnet, we’ll discuss authentication procedures. SMTP authentication helps prevent large amounts of spam from reaching reader inboxes, though not all mail exchange servers require it. Understanding authentication is also crucial when analyzing email headers for deliverability troubleshooting.

The primary difference in modern authentication protocols is the presence of a base64 encoding. Base64 converts binary data into the ASCII-text format required by mail servers for successful data transmission. It’s a way of representing your login credentials — some combination of text — in numeric format the computer can understand.

You can generate your base64 using software or free online tools. Once you communicate the information to the mail server, it compares this data with its records to determine authentication.

To test SMTP authentication via telnet, complete the following steps:

  • Open the terminal and connect with the mail server using the telnet server name and access command — mail.port25.com in the example above.
  • Greet the server with EHLO or HELO, enter AUTH LOGIN, and wait for the computer’s response.
  • Enter the base64-encoded user name and allow the server to answer.
  • Enter the password encoded in base64, and you should receive a response such as "authentication succeeded."
  • Proceed with MAIL FROM, RCPT TO, DATA, and QUIT to send your authenticated email.

Other news