How to test SMTP operations using Telnet
This article describes how to test the Simple Mail Transfer Protocol (SMTP) service for any system with No Authentication turned on.
Connect to the Internet in case you are a dial-up user. Open an MS-DOS prompt, and enter this command:
C:\WINDOWS>telnet mail.monitortools.com 25
This will open a Telnet window, and within a short time, you will be connected to the SMTP server, and the server says:
220 computername.microsoft.com ESMTP Server (Microsoft Exchange Internet Mail Service 5.5.2651.58) ready
This varies, but you should definitely see the '220' part. It is an indication that the server is ready to service your request.
Now the server expects you to identify yourself. If you are a dial-up user, you can enter the name of your computer (the one Windows asks you when you intall Windows) or anything else you want. If you have a domain-name, then you should enter the domain-name here. My computer's name is dell01, so I say:
Note that it is 'helo' and not 'hello'. The commands are not case-sensitive, so you can also say HeLo or HELO or hELo. The server replies:
250 HELO 126.96.36.199, How can I help you?
This is like a shake-hand. You tell the server your name, and it says its name! Computers are quite friendly, you see!
Next give the server your e-mail address. Note that most SMTP servers require that your e-mail address belong to the same domain as the server. For example, if you send mail from Yahoo! SMTP server, you should have a Yahoo! address. You cannot use it if you give it a Hotmail address. Let me give the SMTP server some e-mail address:
mail from: email@example.com
'mail from:' is a SMTP command. Note that there is a space between 'mail' and 'from', followed by a colon (:). The server says:
Tell the server who you want to send the e-mail to. Let me send a mail to info@activexperts:
rcpt to: firstname.lastname@example.org
There are no restrictions here. You can enter any e-mail address. If there is some problem with the recipient-address, your mail will bounce, but for now, the server doesn't complain. It will say:
You have told the server your e-mail address, and the recipient's e-mail address, so now you can go ahead and type the e-mail. You have to do that with the data command:
The server asks you to go ahead with your e-mail:
354 End data with .
Don't worry with the thing. It'll be explained later.
Now type in your e-mail, like this:
This is a test e-mail. Remember to type it all right. Backspace key doesn't work in Windows Telnet, though it does in Linux. If you make a mistake, try pressing CTRL-h. If it works, well and good.
When you finish your e-mail, press [ENTER], then a '.', and again an [ENTER]. This tells the server that you have finished the e-mail, and it can send it. It will say:
250 Ok: queued as 6AB5150038
Your mail was sent!
Now you can either send another mail, or disconnect from the server. If you want to send another mail, you should repeat the 'rcpt to:' and 'data' commands. There is no need for 'helo' and 'mail from:', because the server already knows who you are. If you want to disconnect, just say 'quit':
The server will reply:
and you will lose connection with the server.
See also : Online SMTP Test