HowTO Send and Receive Email Without an Email Client

There can be situations where we need to send and receive emails without having an access to the email clients. For network and system admins using command line can be a very useful technique. We can troubleshoot the email problems in the fly. I find it very helpful in solving most of the basic email problems. You can diagnose simple problems like; incorrect login name/password, connection problem to the server, mail box full etc… . To send and receive emails without an email client you need to have access to a PC with internet connection, your username, password and pop3/smtp server name.

In this Example I’ve used following parameters (don’t try the same username and password, it will not work. You should use your own username, password and mail server):

    UserName: user
    Password: password
    Pop3 Server: pop3server.nirlog.com
    SMTP Server: smtpserver.nirlog.com

Receiving Email

Go to command prompt. This can be done as following:

    Start –> Run –> type “cmd” in the box –>OK

Telnet to the mail server (POP3 Server) and use your username password to login:

    telnet pop3server.nirlog.com 110

The server will reply like this:

    +OK <2324.1138330846@pop3server.nirlog.com>

Login to the mail server:

    user username

The server acknowledges with:

    +OK

Now input your password:

    pass password

If the password is correct the server responds with:

    +OK

Check your emails:
To see how many emails you have in your box use the command:

    list

This will list out the emails you have in your inbox:

    +OK
    1 1623
    2 1601
    3 1596

1, 2, 3 are the email ids and the 1623, 1601, 1596 are size of respective emails in bytes.
To read your emails you need to use command retr email id. E.g. if you want to read the first email then you should:

    retr 1

To delete the emails you need to to use dele command. E.g. to delete the first email you should:

    dele 1

To exit form the server use command quit.

Click for full size
Pop3 Cmd Line

Sending Email

Go to command prompt. This can be done as following:

    Start –> Run –> type “cmd” in the box –>OK

Telnet to the mail server (SMTP Server):

    telnet smtpserver.nirlog.com 25

The reply should be like:

    220 smtpserver.nirlog.com ESMTP

Greet the SMTP Server using helo command, after the helo you can put any domain (I’ve used nirlog.com):

    helo nirlog.com

The server will respond with something like this:

    250 smtpserver.nirlog.com

Input your email address. The sender’s email address:

    mail from: user@nirlog.com

This should give:

    250 ok

Input the recipients email address:

    rcpt to: niranjan.kunwar@gmail.com

This should give:

    250 ok

Compose your email with subject and body:

    data

This should give:

    354 go ahead

Now write the subject of your email:

    Subject: This is a Test Subject (Press Enter twice, this is how Subject and body of an email is separated)

Write the body of the email:

    This is a test mail from command line
    .

After the message body you need to press Enter, type a dot “.” and one more Enter. This way you’ll tell the SMTP server that you’re done writing the email. The server will reply with:

    250 ok 1138345550 qp 22585

This means email has been accepted by the server and is queued for delivery.
You can exit from the server using command quit.

Click for full size
SMTP cmdline

Be Sociable, Share!
Posted in Admin, Email, HowTo, Network, Technology
One comment on “HowTO Send and Receive Email Without an Email Client
  1. neteng says:

    This is really handy Niranjan! I used to use this quite a bit when I worked more with internal email at my previous company. It also really helps you understand what’s going on behind the scenes of email applications.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Recent Comments

From Wikipedia, the free encyclopedia – Ram Bahadur Bomjon on Buddha Boy attacked and injured a guy with his sword?: […] Niranjan (July 20, 2007). “Buddha Boy…(September 2, 2017, 5:07 pm)
Micle on How I Prepared and Passed CISSP : Nice Aritcle…(August 10, 2017, 8:51 am)
David on How I Prepared and Passed CISSP : I am very happy to read this…(August 10, 2017, 8:21 am)
95Russell on Simulating Cisco and Linux Networks: Hello blogger, i must say you have…(August 5, 2017, 8:30 pm)
amberhina on DNS Amplification Attack: Thank you for helping us with DNS…(August 4, 2017, 10:11 am)