How to Check an SMTP Connection with a Manual Telnet Session
·
Feb 7, 2020
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 LOGINcommand 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 typeQUIT.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.
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 of RFC 2821.
How Do I Send an Email Using Telnet?
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.



