Search code examples
smtpgmailcommandtelnet

How can I connect to SMTP using TELNET?


I'm trying to connect to GMAIL SMTP via TELNET.

When I type the command

mail from: [email protected]

it shows me the message

530 5.7.0 Must issue a STARTTLS command first. N72sm4504959yhh.21.

What is happening?


Solution

  • You can only connect to Google's mail services via an encrypted connection. TLS is the encryption scheme being requested. Since you're using Telnet, this is not something you're going to be easily able to do.

    (pretty much you'd have to encrypt as you type and be able to read the encrypted response or decrypt it to understand it).

    If your client does not support SMTP authentication, you won't be able to send mail through your client using your Gmail address.

    TLS: TLS (Transport Layer Security) is a way of changing data such as your username and password into code as it travels across the Internet, so that the data will be secure and private. With mail delivery, TLS begins with an unsecured connection to the mail servers, and then upgrades to a secure connection once information is sent.

    Source: Connecting other clients to Google Mail

    EDIT

    I guess one should also ponder the question "why?"