How to Connect to an SMTP Server Via Telnet
- 1). Click on the Windows Start button, then click on "All Programs." Click on the "Accessories" folder. Click on "Command Prompt."
- 2). Type "telnet mailserver.com 25" at the Command Prompt to connect to the mail server through telnet. Replace "mailserver.com" with the address of the mail server. If the mail server uses a non-standard SMTP port, change "25" to the port number used by the mail server for SMTP connections. Once connected to the mail server, you will see a welcome message similar to the one shown below.
"220 mailserver.com ESMTP Postfix"
The "220" code indicates that the connection was successful. - 3). Type "EHLO domain.com" where "domain.com" is a valid domain authorized to send email through the SMTP server. If the domain is valid, the mail server responds:
"250" - 4). Type "MAIL FROM: user@domain.com" replacing "user@domain.com" with a valid email address. This should be a real email address so that non-delivery messages are received if the mail cannot be sent. The mail server responds:
"250 Ok" - 5). Type "RCPT TO: user@domain.com" replacing "user@domain.com" with the email address of the person you are sending the email to. The mail server responds:
"250 Ok" - 6). Type "data." This tells the mail server you are going to type the message to be sent in the email. The mail server responds:
"354 End data with <CR><LF>.<CR><LF>"
Where "<CR>" represents a carriage return, and "<LF>" represents a line feed. These are used to tell the mail server you have finished typing the email message. - 7). Type in the message to appear in the body of the email, then press the Enter key. Type "." and press the Enter key again to terminate the message. The mail server replies with:
"250 Ok: queued as 4B6F2610612"
This indicates the message has been accepted by the server, and is queued for sending. - 8). Type "Quit" to close the telnet connection to the mail server. Type "exit" to close the Command Prompt.
Source...