554 5.6.0: email message is malformed, not accepted
The receiving server refused the message because its content or structure is broken, for example bad MIME boundaries, invalid encoding or headers that don't follow the standard.
554 5.6.0 Email message is malformed. Not accepted.
Gmail's text for 554 5.6.0, as listed in Google's SMTP errors reference (the published line then points to the sender guidelines and RFC 5322).
What 554 5.6.0 means
RFC 3463 defines X.6.0 as "Other or undefined media error": something about the content of the message made it undeliverable, and no more specific code fits. RFC 5321 defines 554 as "Transaction failed". Together they mean the server read the message and refused it because of how it is built, not because of who sent it.
Gmail returns 554 5.6.0 "Email message is malformed. Not accepted." and points senders to its email sender guidelines and RFC 5322, the Internet Message Format. Typical faults are MIME parts with missing or mismatched boundaries, headers with invalid characters or broken line folding, wrong Content-Transfer-Encoding, and bare line feeds where the standard expects CRLF line endings. These almost always come from software that builds messages by hand, or from a gateway or footer tool that edits messages in transit.
Because the reply is 5xx, the message bounced. Rebuild it with a standard mail library, or send a test through a normal mail client to see if the same content goes through. If a relay sits between you and Gmail, send a test that bypasses it to find out whether it's breaking the message.
Likely causes
- Broken MIME structure, such as missing or mismatched boundaries between parts.
- Headers with invalid characters, bad folding or duplicates.
- Bare line feeds or inconsistent line endings from a script.
- A gateway, disclaimer or footer tool that damages the message while editing it.
How to fix it
If you sent the message
- Send the same content from a normal mail client; if it goes through, the problem is in the software that built the original.
- Use a maintained mail library instead of writing MIME by hand.
- Check any relay or footer tool in the path by sending one test that bypasses it.
If you're the recipient or their admin
- No action needed at Gmail: the sending system has to produce a well-formed message.
Frequently asked questions
What does 'media error' mean in 5.6.0?
In enhanced status codes, the middle 6 covers message content or media. RFC 3463's X.6.0 is the catch-all for a content problem that no more specific code describes, such as a broken MIME structure.
Will resending fix a 554 5.6.0 malformed message?
No. The same message will be refused again. Rebuild it with standard mail software, or find the relay or script that damages it, then send again.
Sources
- Gmail SMTP errors and codes (Google Workspace Admin Help)
- RFC 3463: Enhanced Mail System Status Codes
- RFC 5321: Simple Mail Transfer Protocol (reply codes, section 4.2)
- Email sender guidelines (Gmail Help)
Provider messages are quoted as the provider publishes them. Servers can change their wording, so the bounce you received may differ slightly.
Related codes
- 554 SMTP 554: transaction failed
- 550 5.6.11 550 5.6.11: invalid characters (bare line feeds)
- 550 5.7.1 Gmail 550 5.7.1: message is not RFC 5322 compliant
- 552 5.7.0 Gmail 552 5.7.0: content presents a potential security issue
- 553 5.1.2 553 5.1.2: we weren't able to find the recipient domain
- 550 5.7.1 Gmail 550 5.7.1: the IP you're using to send email is not authorized
- 554 Yahoo 553 / 554 authentication failures: message rejected
Related guides
Why are my website form emails going to spam?
Why WordPress and contact form emails land in spam or vanish: PHP mail(), the From address, SPF and DKIM for the sender, and switching to authenticated SMTP.
9 min read Running email day to dayHow to read email headers
Read email headers step by step: the Received chain from the bottom up, Authentication-Results, ARC, Return-Path, Message-ID and Microsoft 365 anti-spam fields.
10 min read Email security basicsWhat is SMTP and how does it deliver email?
How SMTP moves email between servers: the EHLO, MAIL FROM, RCPT TO and DATA dialogue, envelope vs header From, relays, retries and what reply codes mean.
9 min read