Shortcut Menu

Skip

Main Navigation

Choose your language

You are here:

ActiveXperts.com > Email Component > POP3 Telnet

ActiveXperts Email Component Add SMTP/POP3 capabilities to any Windows or .NET application

Quicklinks


Receiving an e-mail via Telnet

In this document, we:

  • shall use Telnet to connect to the POP3 server;
  • shall logon to connect to our mailbox, and receive our e-mails;
  • disconnect.

The steps are quite similar to what you do when you send an e-mail from - for instance - Outlook Express. We are going to use the POP3 server of windowsmanagement.com with the ID 'webmaster'.


Step 1

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.windowsmanagement.com 110

This will open a Telnet window, and within a short time, you will be connected to the POP3 server, and the server says:

+OK smtp.nlhosting.nl Merak 7.2.0 POP3 Fri, 22 Sep 2006 15:08:41 +0200 <200841@smtp.nlhosting.nl>

This varies, but you should definitely see the '+OK' part. It is an indication that the server is ready to service your request.


Step 2

Now you have to log in to the server. Type in your user name with this command: (substitute your user name for user-id)

user user-id

That was the first command you entered, and soon the server will say:

+OK password required.

Type in your password:

pass your_password

If you entered the right pair of user id and password, the server will give a message like this:

+OK maildrop ready, 2 messages (11086 octets) (15223 4194304)

Some servers give a more conservative message:

+OK

If that is the case, use this command to check your mailbox:

stat

The preply will be like:

+OK 2 11086

The server says you have 2 messages, occupying 11086 octets. Don't worry about the second number: what you need is the first.

If on the other hand, you entered the wrong password, or made a typing mistake, the server will say:
-ERR login failed.

You can then retry the user/pass commands.


Step 2

Now that you have been authenticated, you can freely see what mails you have got. Since you have got two mails, let's check them one by one. First let us retrieve the first mail:

retr 1
+OK 6661 octets
the e-mail will appear here ...

A single dot like the one above signifies end of mail. If the output scrolled too quickly, don't worry. It will be saved in the log file anyway. If the mail was spam (or you don't need to save it), you can delete it with the following: (NOTE: Follow the "dele" command with the corresponding number of the email)

dele 1
+OK message 1 marked for deletion.

You can similarly check other mails also.

retr x

retrieves e-mail x, where x is the number of the e-mail.

dele  x

deletes e-mail x.


Step 3

Finally, you have seen all the messages. Let us terminate the session:

quit
+OK server signing off.

Telnet will report 'Connection to host lost'. That's it. We have checked mail manually, direct from the server. It is now safe to disconnect from the Internet, in case you are a dial-up user. You can now see the log file. Open it and read all the e-mails at ease.


Troubleshooting

Now let us look at some problems that might possibly arise:

Telnet says 'Unable to establish connection with mail.domain.com'

Most likely, you have missed the port. Verify whether you typed this command:

telnet mail.windowsmanagement.com 110

Not all servers (including Rediff, Indiatimes etc.) allow POP access. Some servers don't allow direct access. For example, Hotmail can be checked only through Outlook Express or the website.

Server says 'Unknown command'

POP has only a restricted set of commands. Let's see.

mail
-ERR unknown command

So recheck what you typed. There could be some typological mistake.

It just doesn't work! I made some errors but I corrected them

Telnet in Windows doesn't treat the backspace key nicely! If you make an error, hit ENTER and try the command again.

When I say 'retr 2', does the second mail get deleted?

No. Only when you explicitly say 'dele 2' does it get deleted.