Email Not Sent From Gmail: Read the Error First
When Gmail refuses your mail, it names a code and a reason. Match the code to the fix, in order, and stop guessing.
When your email is not sent from Gmail, the failure comes in two shapes. Gmail either rejects the message outright, or it accepts the message and files it in spam. The rejection is the better problem, because Gmail tells you what went wrong. Its FAQ says it sends a rejection code and a reason when messages are rejected. Silent spam foldering gives you no code, so you check reputation instead. Work the rejection path first, because it points at one fix.
Why Gmail stops mail before it is sent
Gmail's guidelines say Google performs checks on messages sent to Gmail accounts to verify they are authenticated. Messages that fail those checks do not get a free pass. Gmail's guidelines say messages that are not authenticated might be marked as spam or rejected with a 5.7.26 error. Gmail's FAQ says messages that aren't authenticated with both SPF and DKIM can get temporary or permanent failure codes, or spam foldering. The same is true for missing DNS records and missing TLS.
Read the error code first
Do not guess. The bounce text names a code, and each code names one gap. Gmail's FAQ gives the meanings.
-
A 4.7.23 code points to a missing or invalid PTR record on the sending IP address. At 5.7.25, Gmail blocked the message because the sending IP address lacks a PTR record.
-
A 4.7.27 code tells you the SPF check failed. At 5.7.27, Gmail refused the message outright for failing SPF.
-
4.7.29 means the message wasn't sent with a TLS connection. At 5.7.29, Gmail refuses the message outright over the same missing TLS.
-
4.7.30 means DKIM authentication didn't pass. At 5.7.30, Gmail refuses the message outright for the same DKIM failure.
-
4.7.31 means the sending domain lacks a DMARC record or a DMARC policy.
-
4.7.32 means the From: header isn't aligned with the authenticated SPF or DKIM organizational domain.
-
5.7.26 is the rejection Gmail's guidelines name for unauthenticated mail.
Each pair of codes names the same gap, so the fix is the same for both codes in a pair.
SPF failures
Gmail's guidelines say all senders must set up SPF or DKIM email authentication for their sending domains. An SPF failure shows up as 4.7.27 or 5.7.27.
The common cause is an incomplete record. Gmail's guidelines say the SPF record for your domain should include all email senders for your domain. If a tool sends for you and is missing from the record, that is your gap. Gmail's guidelines say if third-party senders are not in your SPF record, their messages are more likely to be marked as spam.
If you have no record at all, start with no SPF record. If you send from Google Workspace, the Gmail SPF record page covers what Google's own systems need. Check the record's syntax too, since a broken record fails as surely as a missing one.
DKIM failures
A DKIM failure shows up as 4.7.30 or 5.7.30. Gmail's guidelines say receiving servers use DKIM to verify that the domain owner actually sent the message. Without a valid signature, Gmail cannot make that check.
There is a size rule as well. Gmail's guidelines say sending to personal Gmail accounts requires a DKIM key of 1024 bits or longer. A short key fails even when the signature is otherwise correct. If you have no signature published, walk through how to set up a DKIM record.
Gmail's FAQ says bulk senders must set up both SPF and DKIM, but only one needs to be aligned. So a DKIM fix can carry a message even where SPF falls short, provided the domains line up.
DMARC and the From: header
That is the 4.7.31 case. Gmail's guidelines say DMARC tells receiving servers what to do with messages that don't pass SPF or DKIM. Gmail's FAQ says messages from a domain with no DMARC policy might be rejected or sent to spam. A missing DMARC record also means delivery support or mitigations are unavailable.
Gmail's guidelines say to pass DMARC authentication, messages must be authenticated by SPF or DKIM, or both. They also say the authenticating domain must be the same domain that appears in the message From: header. When it is not, that is error 4.7.32. Gmail's FAQ says bulk senders must align the From: header domain with either the SPF or the DKIM organizational domain.
If the record is missing, see no DMARC record found. If it exists, the DMARC policy options page covers p=none, quarantine and reject. Gmail's FAQ says messages that fail DMARC are handled based on the sending domain's DMARC policy.
Infrastructure causes
Two failures have nothing to do with SPF, DKIM or DMARC.
The first is reverse DNS. Gmail's guidelines say the public IP address of a sending SMTP server must have a corresponding PTR record that resolves to a hostname. They also say the sending IP address must match the IP address of the hostname specified in the Pointer (PTR) record. Codes 4.7.23 and 5.7.25 are the signals that this lookup chain fails somewhere. Gmail's FAQ says a domain that doesn't have valid forward and reverse DNS records can get temporary or permanent failure codes, or spam foldering.
The second is TLS. Gmail's guidelines say senders must use a TLS connection for transmitting email. Error 4.7.29 or 5.7.29 means the connection was not encrypted. Gmail's FAQ says messages that aren't sent with TLS can get temporary or permanent failure codes, or spam foldering.
Both fixes usually live with whoever runs the sending server. If you own the IP, fix the PTR and enable TLS. If a provider owns it, the fix is theirs to make.
Reputation and spam-rate causes
Sometimes the mail is technically fine and still lands in spam. Gmail's guidelines say over time, user spam reports can lower your domain's reputation. Gmail's FAQ says high spam rates hurt delivery for any message type the sender sends. The impact of the user-reported spam rate is graduated. Gmail's guidelines say maintaining a high spam rate leads to increased spam classification.
Check what Gmail sees. Gmail's guidelines say to check your spam rate and your domain and IP address reputation with Postmaster Tools. Gmail's FAQ says spam rates and other data points are calculated and updated daily there. Gmail's guidelines say it can take time for improvements in spam rate to reflect positively on spam classification. Treat better classification as a slow result, not a same-day one.
Your IP may also be shared. Gmail's guidelines say a shared IP address is an IP address used by more than one email sender. What one sender does on that address shapes the reputation every other sender on it inherits. Gmail's guidelines say messages sent from IP addresses on a blocklist are more likely to be marked as spam. Check whether your IP is blocked.
A fix-first checklist
Work in this order.
- Read the bounce. Note the code and the reason Gmail gives.
- Match the code to the gap using the list above.
- Fix that one gap. Do not change five things at once.
- If there is no code, check your spam rate and reputation in Postmaster Tools.
- Verify the whole DNS setup, record by record, with a DNS lookup. Gmail's guidelines say to use the Google Admin Toolbox to check and fix settings for your domain.
Involve your email service provider when the failing piece belongs to them. Gmail's guidelines say if you use an email service provider, verify that they authenticate your domain's email with SPF and DKIM. They also say to verify an email service provider follows the requirements and guidelines if you have delivery issues. If the provider cannot meet them, that answers the question of whether your email is not sending because of them.
One scope note. Gmail's FAQ says the Email sender guidelines don't apply to messages sent to Google Workspace accounts. All senders, including Google Workspace users, must meet the requirements when sending to personal Gmail accounts. These rules govern mail going to personal Gmail addresses.
Sources
Filed