Telnet is an extremely useful tool for troubleshooting issues related to SMTP and mail flow
For example, you can use telnet to:
- Verify that SMTP is installed properly, and that it has all the necessary commands.
- Ensure that your server is accessible over the Internet.
- Attempt mail delivery directly over the TCP port.
- Determine that all servers are accepting connections.
- Determine if a firewall is blocking a connection.
- Ensure that a single user can receive mail.
- Ensure that a specific domain can receive mail.
- Ensure that a specific user or domain can send mail to your domain.
To use telnet to test SMTP communication
- Open a telnet session: From a command prompt, type telnet, and then press ENTER
- Type o <your mail server domain> 25,and then press ENTER.
- Type EHLO <your mail server domain>, and then press ENTER.
- Type AUTH LOGIN. The server responds with an encrypted prompt for your user name.
- Enter your user name encrypted in base 64. You can use one of several tools that are available to encode your user name.
- The server responds with an encrypted base 64 prompt for your password. Enter your password encrypted in base 64.
- Type MAIL FROM:<sender@domain.com>, and then press ENTER. If the sender is not permitted to send mail, the SMTP server returns an error.
- Type RCPT TO:<recipient@remotedomain.com>,and then press ENTER.If the recipient is not a valid recipient or the server does not accept mail for this domain, the SMTP server returns an error.
- Type DATA.
- If desired, type message text, press ENTER, type a period (.), and then press ENTER again.
- If mail is working properly, you should see a response similar to the following indicating that mail is queued for delivery:
250 2.6.0 <INET-IMC-01UWr81nn9000fbad8@mail1.contoso.com.