OquMail
Loading account…
Deliverability5 min read

530 5.7.0 Must Issue a STARTTLS Command First: Fix

530 5.7.0 Must issue a STARTTLS command first means your mail app or script tried to send before encrypting. Set port 587 with STARTTLS and it stops.

"530 5.7.0 Must issue a STARTTLS command first" means the mail server will not accept anything else, such as a login or a message, until your mail app or script turns on encryption with the STARTTLS command. The server is working; the client skipped a step. It is a settings problem on the sending side, usually an outgoing server set to no encryption, or a script that connects on port 587 but never calls STARTTLS. Switch the connection to STARTTLS on port 587 and the error goes away.

Quick answer

In your mail app, open the outgoing (SMTP) server settings and set encryption to STARTTLS (some apps call it TLS), port 587, with authentication on and your full email address as the username. In code, call starttls() before login, or set the library's STARTTLS option. Do not pick "None" and do not use SSL/TLS on port 587. For OquMail the server is mail.oqumail.com, port 587, STARTTLS.

What the error means

SMTP connections on port 587 (and port 25) start unencrypted. The client says EHLO, the server lists what it supports, and the client then sends STARTTLS to switch the connection to TLS encryption before it logs in. RFC 3207, the standard for STARTTLS, lets a server require this step: it answers every command except EHLO, STARTTLS, NOOP and QUIT with "530 Must issue a STARTTLS command first", and the enhanced status code it recommends is 5.7.0, the general "security" code in RFC 3463. Gmail's SMTP error list includes this exact reply, and most hosted providers behave the same way so that no password crosses the network in plain text.

Where you will see it

  • Outlook or Thunderbird showing "The server responded: 530 5.7.0 Must issue a STARTTLS command first" when you press Send.
  • A website contact form or WordPress SMTP plugin with encryption set to None.
  • A Python, PHP or Node script that connects to port 587 and sends AUTH straight away.
  • A copier or scanner with scan-to-email set up years ago, with TLS switched off.
  • Some servers give the same words with a different number. OquMail's server, for example, answers a login before STARTTLS with code 538 and the same "Must issue a STARTTLS command first" text. The fix is identical.

Fix it in your mail app

  1. Outlook (classic): File, Account Settings, select the account, Change, More Settings, Advanced. Outgoing server port 587, encrypted connection type STARTTLS (older versions say TLS). On the Outgoing Server tab, tick "My outgoing server requires authentication".
  2. Thunderbird: Account Settings, Outgoing Server (SMTP), Edit. Port 587, Connection security STARTTLS, authentication (proof that email really comes from your company) method Normal password, username your full address.
  3. Apple Mail on Mac: Settings, Accounts, Server Settings. Turn off automatic management, set port 587 and tick Use TLS/SSL; Apple uses STARTTLS on 587.
  4. iPhone and iPad: Settings, Mail, Accounts, the account, Outgoing Mail Server, the primary server. Use SSL on, server port 587.
  5. Android mail apps: outgoing server settings, security type STARTTLS, port 587.
  6. Send a test message to an address on another domain.

Free business email on your own domain

OquMail gives you up to 15 mailboxes on your domain — free — with guided SPF/DKIM/DMARC, webmail, IMAP/SMTP for any mail app, and a send API. Setup is a few DNS records; changes usually take effect within minutes, occasionally up to 48 hours. Start at oqumail.com.

Get started free

Fix it in a script or plugin

Most libraries upgrade with STARTTLS automatically on port 587 if you do not force encryption off. The patterns that work:

  • Python smtplib: smtplib.SMTP(host, 587), then ehlo(), starttls(), ehlo(), then login(). Do not use SMTP_SSL on 587.
  • PHPMailer: Port 587, SMTPSecure set to PHPMailer::ENCRYPTION_STARTTLS, SMTPAuth true.
  • Nodemailer: port 587 with secure: false. Nodemailer sends STARTTLS on its own; add requireTLS: true to refuse to continue without it.
  • WordPress SMTP plugins: encryption TLS (meaning STARTTLS), port 587, authentication on.
  • Printers and scanners: choose STARTTLS or TLS on port 587 and update the firmware. Very old devices may not support modern TLS at all; for those, an updated device or a local relay is the realistic fix.
# Check the server offers STARTTLS on 587 (it should print a certificate)
openssl s_client -starttls smtp -connect mail.oqumail.com:587 -crlf

How to confirm it is fixed

Send a test from the app or script to a Gmail address and confirm it arrives. In Gmail, open Show original: the Received line from your provider should mention TLS, and SPF, DKIM and DMARC should pass. If sending now fails with "authentication failed" or 535, encryption is working and the password or username is the next thing to fix; the cannot authenticate guide covers that. If you see "wrong version number" instead, you have SSL/TLS selected on port 587; the STARTTLS and TLS handshake guide explains the pairs that work.

What OquMail users should check

OquMail's outgoing server is mail.oqumail.com on port 587 with STARTTLS, and it refuses logins that are not encrypted. Incoming mail uses IMAP on mail.oqumail.com, port 993, SSL/TLS. The username is the full mailbox address and the password is the webmail password. If the app is right and mail still bounces at the other end, check the domain: the five DNS records in the dashboard (ownership TXT, MX, SPF set to v=spf1 mx a:mail.oqumail.com ~all, DKIM and DMARC) should all be live, which the free SPF checker and DMARC checker confirm. Each mailbox sends up to 250 messages a day.

Common questions

What does 530 must issue a STARTTLS command first mean?

It means the server requires an encrypted connection before it will accept a login or a message, and your app or script tried to skip that step. Turn on STARTTLS for the outgoing server on port 587.

Should I use port 465 instead of 587?

Only if your provider documents 465. Port 465 starts encrypted from the first byte and uses a different setting (SSL/TLS). OquMail uses 587 with STARTTLS. Mixing the two causes other errors; SMTP ports explained shows which goes with which.

Was my password exposed when this error appeared?

Possibly. Some apps send the login in the same command they use to start authenticating, so the password may have crossed the network unencrypted before the server refused it. If that happened on public Wi-Fi, change the password after you fix the setting.

Is "530 5.7.0 Authentication required" the same error?

No. That one means the server wants you to log in before sending. Turn on outgoing server authentication with your full address and password. Without it, many servers answer with relay access denied instead.

Want to see how your own domain is set up? Use the free SPF checker and DMARC checker: they run in your browser and store nothing.