english francais

Sending email via telnet

This article describes how to send an email via Telnet (typically to verify that an SMTP connection can be established successfully between two machines)

Article Details

If you are having difficulty sending email from Enterprise Server then it can sometimes be handy to veryfy the nuts and bolts are all working by trying to establish a no-nonsense connection to your mail server via Telnet (from the machine where ENT Server is installed). The following steps outline how you can do just that...

Step 1

Open a command prompt (Start | Run... cmd.exe), and enter this command:

    C:\WINDOWS>telnet mail.yourdomain.com 25

This will open a Telnet window, and shortly after you will be connected to your SMTP server, which will say something like:

    220 ANYMAIL QMAIL version 3. 1. 1. 0 ESMTP Mail Server Ready

This message will vary depending on your mail server, but providing you see a '220' (which is the numerical response code indicating that the server is ready to receive requests from you) you're on the right track.



Step 2

Now the server wants you to identify yourself. If you have a domain-name, then you should enter the domain-name here. My computer's name is titan, so I say:

    helo titan

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 10.0.1.195, How can I help you?

This is a hand-shake. You tell the server your name, and it says its name (in this case it's IP).



Step 3

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: support@yourdomain.com

'mail from:' is a SMTP command. Note that there is a space between 'mail' and 'from', followed by a colon (:). The server says:

    250 Ok


Step 4

Tell the server who you want to send the e-mail to. Let me send a mail to support@microforge.net:

    rcpt to: support@microforge.net

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:

    250 Ok


Step 5

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:

    data

The server asks you to go ahead with your e-mail:

    354 End data with .



Step 6

Now type in your e-mail, like this:

    Testing 123.
    .

To finish the e-mail, simply enter '.' on a blank line and then hit [ENTER]. This lets the server know that you have finished and that the mail is ready to be sent. The mail server should then say something like:

    250 Ok: queued as 7AC351124

Your mail was sent!



Step 7

Now you can either send another mail, or disconnect from the server. To disconnect just say 'quit':

    quit

The server will reply:

    221 Bye

You should then lose connection with the server.