Note: This was originally posted on a site that I used work on but its no longer online. I still find this tutorial handy when I am testing mail out so I thought I would repost it here for easy access.
When I am setting up an external mail server for a client I sometimes find it useful to test it out by sending the raw commands via telnet. The process is pretty straight forward. I am going to run through it twice in this article depending on the reason you're here:
Getting telnet in Windows Vista
If you follow the tutorial below in vista you will hit a problem almost straight away - telnet is not installed by default in Windows Vista. I have written a separate guide explaining how to install telnet in Windows Vista.
I want to learn what it means
Start off by clicking the Start button and selecting Run...
Type telnet and press enter. Microsoft Telnet Client will start. It looks like a standard dos box.
Type the following command, replacing
mail.server.co.ukwith the url or ip of your mail server.
open mail.server.co.uk 25
25 is the standard SMTP port. Press enter at the end and you will connect to your mail server. If this doesn't work then this is the first sign you have problems.
Some things to check are:
- Did you spell everything correctly?
- Are you connected to the internet?
- If you typed a domain, have you tried the IP?
Next step is to introduce yourself to the mail server. Replace
yournamewith any string you like, its simply used to indentify the sending in the email servers logs.
Tell the mail server who is sending the email. Replace
email@example.com your own email address. Many mail servers will let you get away with a fake email address here, but if you are testing then I would recommend using a real one.
MAIL FROM: firstname.lastname@example.org
Next you have to give the destination email address. Replace
email@example.com your target address.
RCPT TO: firstname.lastname@example.org
To send the body of your message you start off with a
DATAcommand followed by enter. The response from this command will tell you how to end your message. Its almost always a full stop (.) on its own on a new line, but you should note this down.
Type your message.
End the message with the command you were instructed to in step 7 (probably a .).
At this point your email address has been sent. If you want to send another message then you should start over. If not then its good practice to close your connection gracefully by issuing the
If you have used telnet before and know the basics but just need reminding of the details then this quick reference guide should get you through with the minimum of hassle.
open mail.server.co.uk 25 HELO unique-identifier MAIL FROM: email@example.com RCPT TO: firstname.lastname@example.org DATA type your message here . [or whatever identifier you are told to use after DATA] QUIT
If any of these commands don't make sense then hop back up to the top of the page and read the full explanation!