Send email using telnet

A blast from the past! Sending an email using Telnet is a great way to understand the underlying protocol of email transmission. Here's a step-by-step guide to help you send an email using Telnet:

Prerequisites:

  1. You have a Telnet client installed on your computer. If you're using a Windows machine, you can use the built-in Telnet client. On a Mac, you can use the Terminal app.
  2. You have a working email account with a mail server that allows Telnet connections.

Step-by-Step Instructions:

  1. Open your Telnet client and connect to the mail server's SMTP port (usually port 25). For example, if your email account is with Gmail, you would connect to smtp.gmail.com on port 25.

telnet smtp.gmail.com 25

  1. Once connected, you'll see a prompt indicating that you're connected to the mail server. Type HELO (or EHLO for a more modern version) followed by your domain name or IP address. This is the initial greeting to the mail server.

HELO yourdomain.com

  1. The mail server will respond with a greeting message. You'll see a line starting with 250 followed by a message. This indicates that the mail server is ready to accept your email.

  2. Now, you need to authenticate with the mail server. Type AUTH followed by the authentication method you want to use (e.g., PLAIN or LOGIN). For example, if you're using Gmail, you can use PLAIN authentication.

AUTH PLAIN

  1. The mail server will respond with a challenge. You'll need to provide the authentication credentials (username and password) in the format specified by the mail server. For example, if you're using Gmail, you would provide your username and password in the format username:password.

username:password

  1. Once authenticated, you can start composing your email. Type MAIL FROM: followed by your email address.

MAIL FROM: [email protected]

  1. Next, type RCPT TO: followed by the recipient's email address.

RCPT TO: [email protected]

  1. Now, you can start composing the email body. Type DATA to indicate the start of the email body.

DATA

  1. Type the email body, followed by a blank line to indicate the end of the email body.

Subject: Test email sent using Telnet

This is a test email sent using Telnet.

  1. To send the email, type . (a period) followed by a blank line.

.

  1. The mail server will respond with a message indicating that the email has been sent successfully.

  2. To exit the Telnet session, type quit and press Enter.

That's it! You've successfully sent an email using Telnet. Keep in mind that this is a basic example, and you may need to modify the commands depending on your specific email account and mail server configuration.