Troubleshoot SMTP issues using telnet
- Last updated
Save as PDF
There may be times when troubleshooting a workflow which requires sending email, to determine that an SMTP server is available and responsive. The following can be used to confirm this, if telnet is available. This test connects to the external SMTP server and sends a message. Note that this only works for sending unencrypted email.
Below is a generic example of what you would attempt to send and then in (parenthesis) is some information and what you would typically use locally. Case doesn't appear to affect functionality in these tests.
C: is the client input - what you will be typing
S: is the server response - info that you should receive back
C: telnet host 25 (telnet server01 25 - Substitute "host" with the name or ip address of the SMTP server. After this, the screen should clear and you should see something indicating that the SMTP service is ready or something like that)
C: HELO domainname.com (helo ecopy.com - Substitute domainname.com with the domain name)
S: 250 smtp.domainname.com Hello [10.10.10.1] (250 server01.company.com Hello [10.10.3.152] - Indicates that everything is ok so far)
C: MAIL FROM: firstname.lastname@example.org (mail from: email@example.com - This is the sender's email address)
S: 250 2.1.0 firstname.lastname@example.org....SenderOK (Indicates that so far everything is good)
C: rcpt to: email@example.com (rcpt to: support@company. com - Substitute with the email address of the recipient)
S: 250 2.1.5 firstname.lastname@example.org (Indicates that so far everything is good)
C: data (This gets the email prepared for the body of the message)
S: 354 Start mail input. (Indicates that you may start writing the text that will go in the body of the email)
C: Subject: test message (subject: test message - if you don't type "subject", "from" or "to" - it will just leave these blank and still work fine - by the way, you can do cc: also)
C: From: email@example.com (from: firstname.lastname@example.org)
C: To: email@example.com (to: support@company. com)
C: This is a test.
S: 250 Mail queued for delivery. (This indicates that we were successful)