How to Fix SMTP Authentication Errors (535, 530, 534)
A practical, copy-paste friendly guide to debugging SMTP authentication failures across Gmail, Microsoft 365, SendGrid, and self-hosted servers.
A practical, copy-paste friendly guide to debugging SMTP authentication failures across Gmail, Microsoft 365, SendGrid, and self-hosted servers.
SMTP authentication errors return a 5xx response code that tells you exactly what the server rejected. The most common ones you will see are 535 (invalid credentials), 530 (authentication required), and 534 (mechanism too weak). Decoding the response is the fastest way to fix the problem instead of guessing.
When SMTPTester runs your check, it shows the exact reply string from the server. Read that first — it almost always names the cause.
This is the classic "wrong username or password" reply, but the underlying cause is usually subtler. Walk through this checklist:
A 530 reply means the server accepted your connection but refused to relay until you authenticate. Two common causes:
The server requires a stronger mechanism than the one you offered. The most common scenario is presenting AUTH LOGIN over an unencrypted channel. Fix it by enabling STARTTLS on port 587 (or switch to implicit TLS on 465). If your client only supports plain auth, upgrade the library — modern providers will eventually drop legacy mechanisms entirely.
For smtp.gmail.com on port 587 with STARTTLS:
Username: you@gmail.com
Password: <16-char app password>If you use Google Workspace, an administrator may also need to enable "Less secure app access" alternatives — typically by issuing OAuth-based credentials and switching to XOAUTH2. SMTP with app passwords still works for most Workspace tenants as of 2025.
Microsoft 365 disables SMTP AUTH on new tenants by default. As an admin:
Use smtp.office365.com:587 with STARTTLS and the user's full UPN.
Transactional providers use a fixed username (often the literal string apikey) and an API key as the password. Always generate a dedicated, scoped key for each application so you can rotate without breaking other services.
A green check from SMTPTester means the server accepts you as a valid sender. Inbox placement is a separate layer:
If you are seeing 5xx replies that are not on this list, paste the full server response into SMTPTester and we will surface the most likely cause in the recommendations panel.
Apply what you just learned. Free, no signup, results in seconds.
Open the tool →The exact ports, encryption modes, authentication, and timeouts to use for production SMTP — plus a copy-paste config for the top providers.
ArchitectureA pragmatic comparison of SMTP relay and HTTP API based email sending — performance, observability, deliverability, and when to pick each.