421-4.7.0 Try again later, closing connection (EHLO): fix
The error "421-4.7.0 Try again later, closing connection. (EHLO)" means Google's SMTP server is temporarily refusing your session, usually because of connection volume, a low-reputation IP, or a weak relay setup. Slow down, reuse one connection, queue with retries, authenticate, and send a real EHLO hostname.
Sohail Hussain11 min readShort answer
- This is a temporary Google rejection at the EHLO step. Retry with exponential backoff, and stop opening a new connection for every message.
- Reuse one or two pooled connections, send a real EHLO hostname instead of 127.0.0.1 or localhost, and make sure your sending IP has matching forward and reverse DNS.
- If the 421 only appears at volume, you are probably sending more than the relay or mailbox is meant to handle.
You are sending through smtp-relay.gmail.com (from Nodemailer, Nextcloud, a script or an app) and some or all messages fail with this:
Expected response code "250" but got code "421", with message "421-4.7.0 Try again later, closing connection. (EHLO)"
Sometimes it works, sometimes it doesn't, and it gets worse when you send in a loop.
What the error means
| Part | Meaning |
|---|---|
421 | Temporary failure. Google's help says 4xx errors are temporary and the sender will try again. |
4.7.0 | Enhanced status code for a security or policy class problem, with no specific detail. |
Try again later, closing connection. | Google's generic text. It does not say which limit or check you hit. |
(EHLO) | The command Google was answering when it refused. Your client sent EHLO and expected a 250 capability list. |
Errors that start with a 4 are temporary failures, and the sender is expected to try again. Google lists this exact line in its SMTP error table as a 421 4.7.0 "Try again later, closing connection" with the command appended. The "Expected response code 250" wording comes from your client library (Nodemailer, or Symfony Mailer in Nextcloud). Your code is not malformed; Google chose to end the session.
The refusal happens before any message is submitted, so nothing was accepted on that connection.
Why it happens
Google does not say which rule triggered this specific line, so I can't tell you the cause from the message alone. People on vendor and developer forums report the same few patterns, and they match what Google documents elsewhere:
- Too many connections or too fast a loop. One connection and EHLO per recipient creates a burst. Google's relay guidance says that on temporary rate-limiting responses such as 421 4.7.0 or 421 4.4.5, senders must use exponential backoff, because rapid consecutive retries make the rate limiting worse and prolong deferral.
- A weak or unknown sending IP. Google lists a separate 421 4.7.0 for messages that are suspicious because of the very low reputation of the sending IP address, which is temporarily rate limited. Fresh VPS addresses and shared cloud ranges are the usual suspects.
- Missing PTR or mismatched forward DNS. Google lists a 421 4.7.0 for an IP with no PTR record, or whose forward DNS entry does not point to the sending IP.
- A poor EHLO identity. Reports mention
EHLO 127.0.0.1andEHLO localhost. Google's relay error page says that to relay for a domain that is not registered in your account, you must configure your server to use SMTP AUTH or to present one of your domain names in the HELO or EHLO command. - Relay limits. Google documents daily and peak relay limits (see the table below).
Step-by-step fixes
Fix 1: Slow down, pool connections and back off
This is the most likely fix for bulk scripts. Confirm it by checking whether a single test message sent alone succeeds while failures begin after the first handful in a batch.
- Create the transport once and reuse it. In Nodemailer, turn on pooling with low limits:
const transporter = nodemailer.createTransport({
host: "smtp-relay.gmail.com",
port: 587,
secure: false,
requireTLS: true,
pool: true,
maxConnections: 2,
maxMessages: 50,
rateDelta: 1000,
rateLimit: 2,
name: "mail.example.com", // EHLO hostname, see Fix 3
auth: { user: "relay-user@example.com", pass: process.env.SMTP_PASS }
});
- Remove
Promise.allover your recipient list. Pull recipients from a queue at a fixed rate. - On any
421, requeue the message and wait before retrying. Use growing delays (for example 1, 2, 5, 15 minutes) and cap the attempts. - If errors continue, drop to one connection and a few messages per second, then raise the rate slowly.
The numbers above are my starting points, not Google limits. Google does not publish a threshold for this response. Its sender guidelines give the same advice in plain terms: if messages start bouncing or being deferred, reduce volume until the SMTP error rate drops, then increase slowly again.
Do not retry in a tight loop
Immediate retries after a 421 are the most common way to turn a short deferral into a long one. Always wait, and make the wait grow.
Fix 2: Check the relay setup in Google Admin
smtp-relay.gmail.com is a Google Workspace service that an admin configures. Google's setup page puts it in the Admin console under Apps > Google Workspace > Gmail > Routing, where the SMTP relay service setting lives.
- Ask a Workspace admin with Gmail settings privileges to open that setting.
- Review the allowed senders and authentication options. Do not depend on an IP allow-list alone; if your outbound IP changes (autoscaling, NAT pool, redeploy), Google stops recognizing you.
- Prefer SMTP authentication where your setup supports it, so identity does not depend on the source IP.
- Connect on port
587with STARTTLS, or465. Google's app-sending page says the relay accepts ports 25, 465 or 587. - If the relay setting is new, check the separate relay error list in Google's help for messages such as "Mail relay denied" or "Invalid credentials for relay", which are different problems from this 421.
Fix 3: Send a real EHLO hostname and fix reverse DNS
- Turn on SMTP debug logging and read the
EHLOline your client actually sends. - If it is
127.0.0.1,localhostor a bare internal name, set it to a fully qualified domain name you control. In Nodemailer that is thenameoption shown above. In Nextcloud, set the mail domain or server hostname so it is not left at localhost. - Make the hostname resolve to the sending IP, and make that IP's PTR record point back to the hostname:
mail.example.com. IN A 203.0.113.25
25.113.0.203.in-addr.arpa. IN PTR mail.example.com.
Replace 203.0.113.25 with your real IP; it is a documentation address. The PTR record is set by whoever owns the IP block, usually your host or cloud provider, not in your own DNS zone.
Fix 4: Check the IP's reputation
- Test the same code and credentials from another network, such as your laptop. If it works there and fails from the server, suspect the server's IP.
- Check the IP against public DNS blacklists and follow each list's own delisting process.
- Move bulk sending off a bare VPS onto authenticated mailboxes or a proper email service provider.
Sender reputation recovers over days to weeks of clean, steady, low-volume sending. There is no switch to clear it.
Fix 5: Stay inside relay limits
Google documents limits for the relay. These figures come from Google's help pages and can change, so verify them before you plan around them.
| Limit | Value (as of November 2026) | Source page |
|---|---|---|
| Recipients per user per day | 10,000 | Send email from a printer, scanner, or app |
| Recipients per SMTP transaction | 100 | SMTP relay service error messages |
| Daily and peak customer limits | Named in Google's help, with figures on the SMTP relay setting page | SMTP relay service error messages |
Hitting the daily or peak limits normally produces a named relay message, such as "Peak SMTP relay limit exceeded for customer", which Google marks as a temporary error. If your log shows only the generic EHLO line, the cause is more likely connection behavior, IP or DNS.
How to tell which cause you have
| What you see | Likely cause | First fix |
|---|---|---|
| Fails after the first few messages in a loop; a single test works | Connection burst | Fix 1 |
| Works from your laptop, fails from the server | IP reputation, PTR or allow-list | Fixes 2, 3, 4 |
Debug log shows EHLO localhost or EHLO 127.0.0.1 | Bad EHLO identity | Fix 3 |
| Worked for weeks, broke after a redeploy or server move | Outbound IP changed | Fix 2 |
| Only large batches fail | Volume or relay limits | Fixes 1 and 5 |
Keep the full transcript
One error line says little. The sequence of connects, EHLOs and replies, with timestamps, shows whether you are opening too many sessions and which IP and hostname Google saw.
Checklist before you try again
- One pooled transport, not a new connection per message
- A queue with a fixed send rate, not a tight loop
- 421 responses retried with growing delays and a retry cap
- EHLO name is a real hostname that resolves to your sending IP
- PTR record exists and points back to the same hostname
- Relay settings reviewed by your Workspace admin
- Port
587with STARTTLS (or465), no plaintext fallback - Sending domain has SPF, DKIM and DMARC; our SPF generator, DKIM generator and DMARC generator can build the records
For general pacing rules, see email throttling and rate limits.
If nothing works
If the error is constant rather than intermittent, your authentication and EHLO are correct, and the IP is clean, ask your Workspace admin to open a case with Google Workspace support from the Admin console. Include the exact error text, timestamps with time zone, the sending IP, the EHLO name, the port, and the relay settings in use. Say what you already tried.
Subject: Intermittent "421-4.7.0 Try again later, closing connection. (EHLO)" on smtp-relay.gmail.com
Since {date}, our server at {sending IP} gets this reply to EHLO from smtp-relay.gmail.com
on port 587 (STARTTLS):
421-4.7.0 Try again later, closing connection. (EHLO)
Timestamps (with time zone): {list 3-5 examples}
EHLO name we send: {mail.example.com}; PTR for the IP resolves to the same name.
Relay settings: allowed senders {IPs / authenticated users}, SMTP auth required: {yes/no}.
Already tried: pooled connections (max 2), a queue at about 2 messages per second,
exponential backoff on 4xx.
Please tell us whether the IP, the domain or the relay setting is being rate limited.
Google may not share internal thresholds, but a transcript helps separate a policy deferral from a configuration error.
Where Mailneo fits
This is mainly a developer relay problem. Mailneo does not change how smtp-relay.gmail.com treats your server, and it is not an SMTP relay or transactional API for other apps, so it is not a drop-in replacement for one.
It can help if the 421s come from sending campaigns in bulk through Gmail or Workspace mailboxes. Mailneo sends through mailboxes you connect and lets you pace sends with minutes per lead, sending hours and days, and per-mailbox daily caps in rotation. It also applies its own conservative per-provider throttling. Those are Mailneo's settings, not Google's limits, and they reduce bursts without guaranteeing a 421 never appears. It also checks SPF, DKIM and DMARC for your sending domain. See connecting email accounts and how campaigns work.
Common questions
Is the 421-4.7.0 error permanent?
No. 4xx replies are temporary, and Google's own help says the sender will try again. Your mail server or script should queue the message and retry with backoff rather than drop it.
Does this mean my message content was flagged?
Not necessarily. The error is raised at EHLO, before any content is sent. Google lists separate 421 4.7.0 messages for suspicious content, which arrive after the message is submitted.
How is this different from 421 4.7.28?
Google documents 4.7.28 as a temporary rate limit after it detects an unusual rate of email from an IP, domain or URL. The 4.7.0 EHLO line is more generic, and Google's own page does not tie it to one cause, so work through the causes above in order. For the broader sender rules, see Google's Gmail SMTP errors and codes page.
Should I switch to smtp.gmail.com instead of the relay?
It is an option for low volume. Google's app-sending guide lists smtp.gmail.com with port 465 for SSL or 587 for TLS, but per-account limits apply. For real bulk volume, use a service built for it. Google's setup steps are in its guide to routing outgoing SMTP relay messages.
Explore: Email Deliverability
Related Articles
550 5.4.5 Daily user sending limit exceeded in Gmail: fixes
550-5.4.5 means your Gmail or Google Workspace account used up its sending quota for a rolling 24-hour window. Every recipient counts, including Cc and Bcc, so a few messages can use up the quota. Stop sending, wait, then send smaller batches or move bulk mail to a sending service.
550-5.7.26 Unauthenticated Email Rejected by DMARC: Fix
The 550-5.7.26 error means Gmail received mail with your domain in the From address, and neither SPF nor DKIM passed with alignment, so your DMARC policy told Gmail to reject it. Fix it by authenticating the third-party sender with DKIM keys for your domain, or move that sender to a subdomain.
550 5.7.26 Sender Is Unauthenticated: Gmail Block, Fixed
The Gmail bounce 550 5.7.26 means the message had no SPF or DKIM pass that Gmail could trust for the From domain, or the domain's DMARC policy said reject. Find your cause (send-as, forwarding, shared DKIM, visitor From addresses, or a moved domain), then publish the matching SPF or DKIM record.
421-4.7.0 Gmail Has Detected This Message Is Suspicious: Fix
The 421-4.7.0 "suspicious due to the nature of the content and/or the links" error means Gmail's content filter rejected your message after DATA, not an authentication check. Remove click tracking or move it to your own domain, drop URL shorteners, check link reputation, then retest with a plain message.
Ready to supercharge your email marketing?
Start sending smarter emails with AI-powered campaigns. No credit card required.
Get Started Free