How to send mail using telnet

The good old days of using Telnet to send email!

To send an email using Telnet, you'll need to follow these steps:

Prerequisites:

  1. You have a Telnet client installed on your computer (e.g., Windows, macOS, or Linux).
  2. You have a working internet connection.
  3. You know the SMTP (Simple Mail Transfer Protocol) server address of the email service you want to use (e.g., Gmail, Outlook, or your email provider's SMTP server).

Step-by-Step Instructions:

  1. Open a Telnet client on your computer. You can use the built-in Telnet client on Windows (Press Win + R, type telnet, and press Enter) or use a third-party Telnet client like PuTTY on Windows or the built-in telnet command on macOS/Linux.
  2. Connect to the SMTP server using Telnet. Replace <smtp_server> with the SMTP server address of your email service:
    telnet <smtp_server> 25

    For example, to connect to Gmail's SMTP server:

    telnet smtp.gmail.com 25
  3. Once connected, you'll see a prompt like 220 smtp.gmail.com ESMTP. This indicates that the SMTP server is ready to receive your email.
  4. Start by sending the HELO command to introduce yourself to the SMTP server:
    HELO your_email_address

    Replace your_email_address with your actual email address.

For example:

HELO [email protected]
  1. The SMTP server will respond with a greeting message. You'll see a line starting with 250.
  2. Now, send the MAIL FROM command to specify the sender's email address:
    MAIL FROM: your_email_address

    Replace your_email_address with your actual email address.

For example:

MAIL FROM: [email protected]
  1. The SMTP server will respond with a message indicating that the sender's email address is valid.
  2. Send the RCPT TO command to specify the recipient's email address:
    RCPT TO: recipient_email_address

    Replace recipient_email_address with the email address of the person you want to send the email to.

For example:

RCPT TO: [email protected]
  1. The SMTP server will respond with a message indicating that the recipient's email address is valid.
  2. Now, you can send the email body using the DATA command:
    DATA

    This will put you in a state where you can type the email body. You can type multiple lines, and each line will be separated by a newline character (\r\n).

When you're done typing the email body, press Enter twice to send the email.

  1. The SMTP server will respond with a message indicating that the email has been received.
  2. To quit the Telnet session, type QUIT and press Enter:
    QUIT

    That's it! You've successfully sent an email using Telnet.

Important Notes: