Test SMTP servers with Telnet

How to use Telnet to test the SMTP servers?

An SMTP server malfunction can be overcome by connecting to an application protocol like Telnet directly from your local computer.

What is SMTP?

Simple Mail Transfer Protocol (SMTP) is among the TCP/IP protocols used by email services to route your message to the recipient anytime you send a message.

What is Telnet?

Telnet(teletype network) is a networking protocol aiding a computer to access another, imparting a two-way channel for text-based communication between two or more devices.

With a command prompt and the syntax telnet hostname port, a user can communicate with another computer or command another server using Telnet. Unfortunately, it does not support encryption.

Why is Telnet used to test SMTP servers?

Telnet protocol is among the simplest ways to establish a Transmission Control Protocol between devices because it allows for sending plain-text information over a single TCP connection.

Selection between: port 25 and port 587.

Since your application needs both port 587 and SSL/TSL, port 587 is preferable to test an SMTP connection and add additional security.

Setting up Telnet

Guide to test out an SMTP server using port 587 using Telnet.

For Windows

  • Install Telnet. Then, navigate to the `Control panel->Programs->Click "Turn Windows features on or off."’
  • Scroll down to Telnet client. Click the checkbox to enable it.

For Linux

  • Install Telnet using Yum if Fedora and Centos, or Apt on Debian and Ubuntu.


$ yum -y install telnet # fedora / centos $ apt-get install telnet # debian / ubuntu

Depending on Linux System's configuration, use sudo to run Yum or Apt.


Mac users with installed Homebrew can open a terminal using the command:

$ brew install telnet

Installing SSL

Here we have used SSL for encryption along with port 587.

We have installed OpenSSL on Windows.

For Linux, install OpenSSL using Yum or Apt with the command:

$ yum -y install openssl # fedora / centos $ apt-get install openssl # debian / ubuntu

For Mac, we can use Homebrew.

Command: $ brew install openssl

Example of connecting an SMTP server securely using Telnet.

Example: Testing an email with an account name Template.

Start the command prompt to input the following:

$ openssl s_client -starttls smtp -connect template.io:587 ehlo template.net mail from: your@email.com rcpt to: test@m03agkv6.template.net data Subject: This is a test This is a test email to cheque SMTP connectivity. Thanks so much, Joseph Will.

The command openssl s_client -starttls smtp -connect template.io:587 calls upon the Template server using the OpenSSL encryption protocol.

To send an unencrypted message, use the command:

telnet template.com 25

ehlo.template.net begins communicating with the Template server. After hitting enter, you’ll receive a connection establishment message:

250-template.io 250-AUTH LOGIN PLAIN CRAM-MD5 250-SMTPUTF8 250 8BITMIME
mail from: your@email.com s tells from where the email is coming. Telnet responds :
250 sender your@email.com OK

Add a recipient:

rcpt to: test@m03agkv6.template.net states the destination of our email message. Here, the Template test server sends emails. Commas can separate multiple addresses. Fill in the data and press the ENTER key. It starts with the text to send.

Followed by your text, typing Subject: will place that text in the email’s subject line. Pressing ENTER twice at the end of your subject line starts the body of the email message. Press ENTER twice at the end of the body of your text to send the email message. The message is sent to the recipient once you put a period (.) on the current line and press ENTER. Telnet works well for communicating with SMTP, but its lack of security features renders it unsuitable for use with SMTP for anything other than testing.

Related content

Fake SMTP servers for safe testing that prevent any outbound emails from reaching real users

Test emails safely with no risk of spamming users with real emails

Java email library for SMTP and creating email addresses

MailSlurp Java SDK for sending and receive email and attachments on the JVM.

SMTP email application libraries

How to send email in CSharp, PHP, Ruby, Java, Python, and NodeJS using the SMTP protocol and MailSlurp mailservers.

1111 SMTP Connections failing

1111 SMTP Connections failing

How to Send an Email in Python

Send emails using SMTP mailer in Python. Detailed tutorial for sending mail in Python.

How to send emails in Javascript (NodeJS)

JS SMTP email sending guide using HTML and NodeJS.

PHPMailer tutorial (Sending email with PHP)

PHPMailer tutorial (Sending email with PHP)

How to send an email using Powershell (Windows and cross-platform)

Use Send-MailMessage in Windows Powershell to send emails using an SMTP server or MailSlurp's free email API.

How to send email in R

RLang tutorial for sending emails over SMTP.

SMTP Commands and Response Codes List

A full list of commands and response status codes for SMTP mail servers when sending emails.

Test SMTP servers with Telnet

How to use Telnet to test the SMTP servers?

What Is Amazon Simple Storage Service (SES) - And How Can I Use It?

Amazon SES is an email service among virtual servers, AI apps, and libraries. Ideally, you can integrate your email system with your program hosted on Amazon.

Grab all details about an SMTP Port

What are common SMTP mail server ports and how do you find them?

Which SMTP Port Should I Use?

Picking the right port for SMTP mailservers

Avoiding email spam filters

How to send emails that don't trigger a spam warning.

BCC and CC in SMTP emails

What is cc and bcc in email? What is the difference between cc and bcc?

BCC For Email: What It Means And When To Use It

What is BCC email field (blind carbon copy) and how does it differ to CC?

What Is The Best SMTP Port To Use?

MailServers use TCP ports to transmit emails. Picking the right port between 25 vs 2555, 465 vs 587 in SMTP is easy with this guide.

How to configure Mail desktop clients with MailSlurp

How to setup MailSlurp with Outlook, Gmail, Thunderbird, Mail app and more.

Send email with CSharp using SMTP Client and MailSlurp

Create a custom SMTP client and access MailSlurp inboxes from CSharp/DotNET.

DMARC – All Facts that you should know

DMARC – All Facts that you should know

Email size limits

Email size limits

The Fundamentals Of Email Subdomains

How to manage email subdomain custom mailboxes using SMTP/IMAP mailserver settings.

How to send emails in VBA

Send email in Visual basic

A guide to PHP Mailer

A guide to PHP Mailer

SMTP IMAP Settings

How to access MailSlurp email accounts using IMAP and SMTP servers

SMTP Relay for outbound smtp servers

How to use SMTP relay to address spam and security issues that affect outbound mail servers.

SMTP vs HTTP MailSlurp inboxes

The difference between HTTP and SMTP inboxes and domains in MailSlurp.

What are SMTP ports

What are SMTP ports

CSharp send SMTP email

How to use CSharp SMTP client to send email with MailSlurp mail server

Send SMTP email with Java

How to use Java SMTP client to send email with MailSlurp mail server on the JDK

Send emails in NodeJS using SMTP

How to use Javascript SMTP client (or Nodemailer) to send email with MailSlurp mail server

Send SMTP emails with PHP

Use PHPMailer to send emails with SMTP and MailSlurp

Send SMTP email with Python (using SMTPLib)

How to send emails with Python's built-in SMTP client and MailSlurp mail servers.

Ruby send SMTP email

How to use Ruby SMTP client to send email with the MailSlurp mail servers

Ready to dive in?Start building email applications today.