getting "530 5.7.0 Must issue a STARTTLS command first." error when sending mail via netcat

dod picture dod · Nov 11, 2013 · Viewed 64.6k times · Source

I'm trying to send an email with netcat, this is what i get:

****-MacBook-Pro:~ ***$ nc smtp.gmail.com 25
220 mx.google.com ESMTP h8sm66301168eew.16 - gsmtp
Helo gmail.com
250 mx.google.com at your service
MAIL FROM: <******@gmail.com>
530 5.7.0 Must issue a STARTTLS command first. h8sm66301168eew.16 - gsmtp

what is STARTTLS command and what do i need to do with it?

Answer

Ashigore picture Ashigore · Nov 11, 2013

STARTTLS is an extension to plain text communication protocols, which offers a way to upgrade a plain text connection to an encrypted (TLS or SSL) connection instead of using a separate port for encrypted communication.

http://en.wikipedia.org/wiki/STARTTLS

The smtp server is saying it won't accept plain text connections.