more debugs

Monday, December 5, 2011

Telnet - SMTP Commands (sending mail using telnet)

Telnet - SMTP Commands (sending mail using telnet)

In order to access your mailbox you will need three things.

1. An active internet connection.

2. The address of a mail server capable of relaying for you - usually
provided by your internet provider.(e.g. mail.domain.ext)

3. A valid email address(e.g. mail@domain.ext)

After verification of the above mentioned three points go to following steps.

1. The first thing is to do is open a connection from your computer
to your mail server.

telnet mail.domain.ext 25

you should receive a reply like:

Trying ???.???.???.???...
Connected to mail.domain.ext.
Escape character is '^]'.
220 mail.domain.ext ESMTP Sendmail ?version-number?; ?date+time+gmtoffset?

2. You will then need to delcare where you are sending the email from:

HELO

- dont worry too much about your local domain name although you
really should use your exact fully qualified domain name as seen by
the outside world the mail server has no choice but to take your
word for it as of RFC822-RFC1123.
This should give you:

250 mail.domain.ext Hello [loc.al.i.p], pleased
to meet you

3. Now give your email address:

(On many mailservers the space after the : is
required rather that optional.)

MAIL FROM: mail@domain.ext
Should yeild:
250 2.1.0 mail@domain.ext... Sender ok

4. If it doesn't please see possible problems.

5. Now give the recipients address:

RCPT TO: mail@otherdomain.ext
Should yeild:
250 2.1.0 mail@otherdomain.ext... Recipient ok
6. If it doesn't please see possible problems. Note Google mail
servers require < and > around the email address.

7. To start composing the message issue the command DATA

8. If you want a subject for your email type Subject:-type subject
here- then press enter twice (these are needed to conform to RFC 882)

9. You may now proceed to type the body of your message (e.g. hello
mail@otherdomain.ext from mail@domain.ext)

10. To tell the mail server that you have completed the message enter
a single "." on a line on it's own.

The mail server should reply with: 250 2.0.0 ???????? Message
accepted for delivery

11. You can close the connection by issuing the QUIT command.

The mailserver should reply with something like:221 2.0.0
mail.domain.ext closing connection
Connection closed by foreign host.

No comments:

Post a Comment