


In case you have installed the SMTP correctly, but still getting an error while sending emails, then please refer this doc for more information.Despite having been around for a long time, telnet is an invaluable tool for testing a mail server. These are some of the popular methods to check whether the SMTP connection is active on your machine. It will not respond if your SMTP server is not active. Once you hit the above command,you see a lot of verbose.Ībove all, when a connection is successfully established, then you will notice a 250 DSN.Ĭonsequently, once you got 250 DSN you can start now your SMTP transaction now by using below command EHLO “i am here” EHLO i am here openssl s_client -connect :587 -starttls smtp In order to set up a TLS encrypted connection to an SMTP server, you need openssl command. Step 3: Checking SMTP Connection Over TLS Using Openssl Read our detailed blog on TLS Security (Highly Recommended). TLS security is of paramount importance when it comes to email deliverability. The next step is used to communicate through a secure tunnel using TLS. QUITTING.Īll of the above steps are used to check the SMTP connection from command line to a particular port of the host. Ncat: Could not resolve hostname "": Name or service not known. If there is a problem connecting the host auth]# ncat -v -u 587 If it is successfully connected auth]# ncat -v -u 587 Step 2: Checking The SMTP Connection From Command Line Using Ncat Or Ncīecause ncat or nc has various functionality from the list of functionality we will just check the connection using the following command. You can even try sending email using telnet. Output: If it's getting connected properly In order to quit telnet ctrl + ] and quit Telnet SMTP test is one the best ways to figure out your SMTP connection state.ĭid you know that SMTP Port 25 is the default SMTP Port? Read in detail. Smtp servers usually communicate over smtp ports 25, 2525,587. Telnet to your host, you want to check connection. Step 1: Checking SMTP Connection Using Telnet
#How to use telnet to communicate with a smtp server install
Note: If openssl is not installed, copy and paste the below command: sudo yum install openssl

openssl: It's a general purpose library that provides an open-source implementation of SSL and TLS protocol. Note: If ncat or nc is not available, copy and paste the below command sudo yum install nmap-ncat -yģ. ncat or nc: It's a general purpose CLI tool used for port scanning, security tool, and monitoring tool. Note: If telnet is not available, copy and paste the command sudo yum install telnetĢ. If the hostname is not provided it enters into command mode. Telnet: Used to communicate with another host using the telnet protocol. SMTP From Command Line - Some Important Commandsġ.

Note: these commands are Linux specific, so won't work in other environments. It is also the most prominent way to test SMTP Relay. The most common way of checking SMTP from Command Line is using telnet, openssl or ncat (nc) command. To check if SMTP is working from the command line (Linux), is one critical aspect to be considered while setting up an email server. In this article we would be solving one of the most widely searched issues and a potential SMTP connection pain point for the developers. Testing an email server with Telnet client is where we would focus, going forward with our solution. In this conundrum, Telnet is widely used to test SMTP connection breaks. SMTP connection errors could be resolved in numerous ways but command line detects the error from the root quite easily. The author voluntarily contributed this tutorial as a part of Pepipost Write to Contribute program.
