Send emails Using Telnet

Let us see how to send emails using command line client like Telnet, PuTTY etc. This is very useful while troubleshooting email sending issues in Mail client like Outlook Express, MS Office Outlook etc.

Sending emails using telnet by following video and text tutorial ensures that an email will land in recipient’s Inbox, and also there will be no issue of blank From, To and subject fields.

Step by step procedure for sending emails using telnet:

  • Open Command Prompt
  • Type “telnet your_smtp_server smtp_port” and then press enter. The SMTP banner message will greet you.

220 SMTP Server Ready

  • Type HELO command followed by your computer name and press Enter.

HELO MyPCName
250 Hello.

  • Type EHLO command followed by your domain name.

EHLO mail.domain.com

250-HOME

250-SIZE 20480000

250 AUTH LOGIN

  • Depending upon what kind of SMTP authentication is supported by your SMTP server and which method you would like to use issue appropriate command. My server requires AUTH LOGIN method where it asks for username and password separately in Base64 encoded format so I issued AUTH LOGIN command. Other authentication methods are AUTH PLAIN, AUTH CRAM-MD5

AUTH LOGIN
334 VXNlcm5hbWU6

  • In “334 VXNlcm5hbWU6“, VXNlcm5hbWU6 stands for “Username:” in other words SMTP server is prompting for Username which must be Base64 encoded. So, I supplied my username bWFpbEBkb21haW4uY29t and then press enter.

bWFpbEBkb21haW4uY29t

334 UGFzc3dvcmQ6

  • In “334 UGFzc3dvcmQ6“, UGFzc3dvcmQ6 stands for “Password:” in other words SMTP server is prompting for password which must be Base64 encoded. So, I supplied my password bWFpbA== and press enter, in response to this if username and password are correct then it will say “235 authenticated.”.

bWFpbA==
235 authenticated.

  • Enter “MAIL FROM: <your_mail_id>” command and then press enter. Server response will be “250 OK”

MAIL FROM: <mail@domain.com>
250 OK

  • Enter “RCPT TO: <recipient_address>” command and then press enter. Server response will be “250 OK”

RCPT TO: <test@domain.com>
250 OK

  • Enter “DATA” command and then press enter. Server response will be “354 OK, send.”

DATA
354 OK, send.

  • Supply information as shown below, so that when email received by recipient it must show From address, To address, Subject etc., press enter at the end of each line. These information is also important to send the mail in recipient’s Inbox and not in Spam box.

From: “Technology” <mail@domain.com>
To: “Recipient” <test@domain.com>
Subject: THis mail is sent from Telnet Client

  • Enter contents of email body i.e. actual message. At the end of message please enter “.” excluding double quotes to end the “DATA” command and submit the mail in mail queue of SMTP Server for delivery to the recipient.

Hi,

How r u?

This mail is sent from Telnet Client. Please verify if it lands in your mailbox.

Thanks!
.
250 Queued (209.306 seconds)

  • Enter “quit” command when all mails are sent and the session with SMTP server needs to terminate.

quit
221 goodbye

Related Posts

Leave a Reply

%d bloggers like this: