- Start a session with a smtp server (default port is 25):
telnet xxxxxxx.xxxxx.xxx 25 [ENTER]
- Send hand shake with the server to allow sending mail:
HELO xxxxx.xxxxx.xxx [ENTER]
Server will reply “250 Hello”
- Since its an anonymous server we do not need to do AUTH, we start sending MAIL info, this time it will be mail from.
MAIL FROM:<email@example.com> [ENTER]
Again server says “250” which means it accepted your command.
- Next we input recipient using RCPT TO command:
RCPT TO:<firstname.lastname@example.org> [ENTER]
We are good as long as server returns “250”
- Time to enter the mail body, using DATA command:
- Server will return message telling you it’s good to start composing the mail body, with code “354”. We can start putting To, From, Subject, From again and test body, we end all the message with a singel dot”.” on a seprate line:
To:email@example.com [ENTER] From:firstname.lastname@example.org [ENTER] Subject: abcdef..xyz [ENTER] From:email@example.com [ENTER] test body [ENTER] . [ENTER]
- Server will return code “250” again if nothing goes wrong. And we shall get the mail from firstname.lastname@example.org mail box very soon.