Skip to content
MtrXTools

530 5.7.0 Must issue a STARTTLS command first

The server requires TLS before it accepts mail

Seen in Gmail SMTP, Postfix (smtpd_tls_security_level = encrypt), Exchange

The client tried to log in or send over a plain-text connection, but the server only accepts commands after STARTTLS has encrypted the session.

Common causes

  • TLS or STARTTLS is disabled in the mail client, app or library.
  • The app uses port 25 or 587 without upgrading the connection.
  • A firewall or antivirus is stripping STARTTLS from the server greeting.

How to fix it

  1. Enable STARTTLS in the client and use port 587 (or implicit TLS on port 465).
  2. In code, call starttls() before login, e.g. smtplib.SMTP(host, 587) then s.starttls().
  3. If STARTTLS is missing from the EHLO reply, check for SMTP inspection on your firewall.

Got a different message? Paste it into the error explainer.

Related errors

All 33 Email (SMTP) errors