SMTP
"SMTP error: data not accepted" is PHPMailer's wrapper for a rejected DATA command. Learn what the underlying 550/554/552 reply means and how to fix it.
Updated Jul 1, 2026
The short answer
"SMTP Error: data not accepted" is PHPMailer's generic message when the SMTP server rejects your message after you transmit its body (the DATA command, RFC 5321 §4.1.1.4) with a non-250 reply. It is not an RFC code itself; the real reason is in the server's response (usually 550/554 spam or policy rejection, 552 size, or 451 temporary). Enable SMTP debug to read the actual code, then fix that.
This is not a standard SMTP reply code — it is a generic error string produced by the PHPMailer library (and tools built on it, such as many WordPress SMTP plugins, WHMCS, and Mailster). PHPMailer emits it whenever the SMTP server returns a non-250 reply after the message body has been sent — i.e., after the terminating <CRLF>.<CRLF> of the DATA command (RFC 5321 §4.1.1.4).
In other words, the connection, authentication, MAIL FROM, and RCPT TO steps all succeeded — the server accepted the envelope and then rejected the message content. The actual reason is in the server's reply code, which PHPMailer hides behind this friendly string.
Per RFC 5321 §4.2.3, which enumerates reply codes in numeric order, the server's reply at end-of-DATA tells you the real cause. The most common ones:
550 This message was classified as SPAM and may not be delivered (PHPMailer #1370). 554 is a generic "transaction failed," often an unverified/unauthorized sender.SIZE limit.From: header (or Reply-To) doesn't match the authenticated SMTP user or an SPF/DKIM/DMARC-aligned domain. This is one specific case of a 550/554 policy rejection — not the universal cause.Step 1 — Read the real reply code. This is the single most important step. In PHPMailer, turn on debug output before sending:
$mail->SMTPDebug = SMTP::DEBUG_SERVER; // verbose client/server dialog
Look in the dialog for the line right after the message body, e.g. SERVER -> CLIENT: 550 .... Everything below keys off that code. You can also inspect $mail->ErrorInfo.
Step 2 — Fix by code:
From: address uses that domain. Review content for spam triggers and warm up new IPs. If a specific recipient server blocks you, ask their admin to allowlist you.From: (and Reply-To) to an address the SMTP account is authorized to send as — typically the authenticated user or a verified sender on your provider. In PHPMailer use $mail->setFrom('you@yourdomain.com', 'Name') with an actual address, not just a display name.Step 3 — Verify provider auth (if relevant). For personal Gmail, use an App Password (requires 2-Step Verification) or OAuth2 — "Less Secure Apps" was removed in 2022 and is no longer an option. For Google Workspace accounts, Basic Authentication (username/password, including app passwords in many org configurations) for SMTP was phased out starting March 2025 in favor of OAuth2. If you're sending transactional mail via PHPMailer/WHMCS/WordPress from a Workspace account, either implement OAuth2 or use Google Workspace's dedicated SMTP relay service (smtp-relay.gmail.com), which authenticates by sender IP/TLS rather than a user password — check with your Workspace admin about current policy before assuming an app password will work. Ports 587 (STARTTLS) and 465 (implicit TLS, RFC 8314) are both valid.
"Data not accepted" specifically means the handshake and recipient acceptance worked and the content was refused. If authentication itself failed you'd see 535; if a recipient was unknown you'd see 550 5.1.1 at RCPT TO (before DATA). Use the debug dialog to confirm which stage failed.
References
FAQ
No. It is a generic string emitted by the PHPMailer library (and tools built on it) when the SMTP server returns a non-250 reply after the message body is sent. The real RFC 5321 reply code — usually 550, 554, 552, or 451 — is in the server's response, which PHPMailer hides behind this string. Enable SMTPDebug to see it.
One API, every provider
Courier connects to your email, SMS, and push providers, handles retries and failover, and surfaces delivery errors in plain language.
Reply-code definitions per RFC 5321 §4.1.1.4. Last reviewed Jul 1, 2026. Courier is not affiliated with third-party providers; error behavior may vary by implementation.
© 2026 Courier. All rights reserved.