How to test Simple Mail Transfer Protocol notification using telnet

Article: 100013171
Last Published: 2023-10-18
Ratings: 0 0
Product(s): Backup Exec

Problem

How to test Simple Mail Transfer Protocol notification using telnet.

 

Solution

Follow the steps below to test the settings supplied for the "Configure Email and Text Messages" dialog box.
Before entering information of the email server, port number and Sender name / email address, follow these steps to test the settings:

1. Open a Command Prompt window, type telnet, and then press Enter.
This command opens the Telnet session.

Note : if the telnet command shows an error, as "telnet is not recognized as an internal or external command, operable program or batch file"
then make sure the telnet client is installed.

How to install Telnet Client on Windows 

Type set localecho, and then press Enter.
This optional command lets you view the characters as you type them, and it might be required for some SMTP servers.


2. Input the following command :
open <SMTP Server name> 25. This connects to the specified server on port 25.

Example : open MySMTP_Server 25

Note:  Port 25 is the standard SMTP port, but it could also be different. If a connection is not established with port 25, contact the email server administrator.

3. Once connected, enter the following command :
ehlo <your domain name> and then press ENTER.

Example : ehlo MyDomain.com
Response should be :
250-MySMTP_SERVER.MyDomain.com Hello [192.168.0.1]
250-TURN
250-SIZE
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-X-EXPS GSSAPI NTLM LOGIN
250-X-EXPS=LOGIN
250-AUTH GSSAPI NTLM LOGIN
250-AUTH=LOGIN
250-X-LINK2STATE
250-XEXCH50
250 OK

Note : For some systems, the 'EHLO' command may not work and 'HELO' can be tried.

4. Upon successful completion of Step 3, enter the following command :
MAIL FROM:<your Email Address> and then press ENTER.

Example : Mail From:administrator@MyDomain.com
Response should be : 250 OK

5. Upon successful completion of Step 4, enter the following command :
RCPT TO:<recipient address> and then press ENTER.

Example : RCPT TO:administrator@MyDomain.com
Response should be : 250 OK - Recipient <recipient address>
If the Response Fails with Error : Unable to Relay, then Check the Relay Settings in Exchange


For Exchange 2010 : https://technet.microsoft.com/en-us/library/bb232021.aspx
For Exchange 2016 : https://learn.microsoft.com/en-us/exchange/mail-flow/connectors/allow-anonymous-relay?view=exchserver-2016
For Exchange 2019 : https://learn.microsoft.com/en-us/exchange/mail-flow/connectors/allow-anonymous-relay?view=exchserver-2019

6. Upon successful completion of Step 5, enter the following command :
DATA and then press ENTER.

Example : DATA
Response should be : 354 Start mail input; end with <CRLF>.<CRLF>

7. Upon successful completion of Step 6, enter the following command :
Subject: This is a test message and then press ENTER Twice.
There would be no response.

8. Upon successful completion of Step 7, enter the following command :
Testing and then press ENTER.
There would be no response.

9. Upon successful completion of step 8, perform the following :
Press ENTER, Type a Period or Dot (.), and then again press ENTER.

Example :Response should be : 250 OK

10. Upon successful completion of step 9, enter the following command :
quit and then press ENTER.

Example : quit
Response should be : Queued mail for delivery

 

Check if the email has been delivered to the recipient's mailbox.
Once you have verified that the email was delivered successfully, then complete the "Configure Email and Text Messages" dialog box.

The above steps can be found in the following Microsoft Articles.

How to Use Telnet to Test SMTP Communication :

https://technet.microsoft.com/en-us/library/bb123686.aspx
https://learn.microsoft.com/en-us/exchange/mail-flow/test-smtp-telnet?view=exchserver-2016&redirectedfrom=MSDN
https://learn.microsoft.com/en-us/exchange/mail-flow/test-smtp-telnet?view=exchserver-2019&redirectedfrom=MSDN

Was this content helpful?