PHPMailer: SMTP Error: The following recipients failed / SMTP Error: data not accepted
The SMTP server accepted the connection but rejected recipients or the message body.
SMTP Error: The following recipients failedSMTP Error: data not acceptedSMTP ERROR: DATA command failedPHPMailer data not accepted 554SMTP ERROR: RCPT TO command failed Meaning
Read the server reply in the debug output: relay denied, unknown user, spam/policy rejection, size limit or missing authentication. Fix the From address (must match the authenticated domain), use valid recipients, and check content/size. "data not accepted" often means policy or spam blocking.
Common causes
- Recipient rejected (unknown/relay denied)
- From address not allowed for the account
- Message flagged as spam/policy
- Message too large
- Sender domain without SPF/DKIM
⚡ Quick fix
- Enable debug output and read the reply code
- Send from an address owned by the SMTP account
- Authenticate with SPF/DKIM-friendly settings
Detailed fix by platform
PHP
$mail->SMTPDebug = SMTP::DEBUG_SERVER; // shows RCPT TO / DATA replies
How to diagnose
- Reply code — Which?
- From — Allowed?
- Content — Passing filters?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 550 5.7.1 550 5.7.1 Relaying denied / Message rejected as spam / Unauthenticated email not accepted
- 554 5.5.1 554 5.5.1 Error: no valid recipients (all RCPT TO addresses were rejected)
- 554 5.7.1 Message rejected as spam SMTP: 554 5.7.1 Message content rejected / Your message looks like spam (spam score exceeded)
Most viewed in Email / SMTP
- Laravel: Connection could not be established with host Laravel: Symfony\Component\Mailer\Exception\TransportException: Connection could not be established with host "smtp.mailtrap.io:2525": stream_socket_client(): Unable to connect
- SES: Maximum sending rate exceeded Amazon SES: Throttling — Maximum sending rate exceeded (454 Throttling failure)
- self-signed certificate (SMTP TLS) Nodemailer: Error: self signed certificate in certificate chain (code: 'ESOCKET') / unable to verify the first certificate
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 18 Nov 2026