PHPMailer Email / SMTP Origin: Network OSI layer 7 · Application Last updated 18 Nov 2026

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.

Exact message you may see SMTP Error: The following recipients failedSMTP Error: data not acceptedSMTP ERROR: DATA command failedPHPMailer data not accepted 554SMTP ERROR: RCPT TO command failed
Seen on: PHP PHPMailer SMTP

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

  1. Enable debug output and read the reply code
  2. Send from an address owned by the SMTP account
  3. Authenticate with SPF/DKIM-friendly settings

Detailed fix by platform

PHP

  1. $mail->SMTPDebug = SMTP::DEBUG_SERVER; // shows RCPT TO / DATA replies

How to diagnose

  1. Reply code — Which?
  2. From — Allowed?
  3. 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:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

550 5.7.1 — 550 5.7.1 Relaying denied / Message rejected as spam / Unauthenticated email not accepted (Email / SMTP)550 5.7.1554 5.5.1 — 554 5.5.1 Error: no valid recipients (all RCPT TO addresses were rejected) (Email / SMTP)554 5.5.1554 5.7.1 Message rejected as spam — SMTP: 554 5.7.1 Message content rejected / Your message looks like spam (spam score exceeded) (Email / SMTP)554 5.7.1 Message rej…missing the MySQL extension — WordPress: Your PHP installation appears to be missing the MySQL extension which is required by WordPress (WordPress)missing the MySQL ext…PHPMailer: SMTP connect() failed — PHPMailer: SMTP Error: Could not connect to SMTP host. Failed to connect to server (SMTP connect() failed) (Email / SMTP)PHPMailer: SMTP conne…requires at least PHP — WordPress: Your server is running PHP version 7.2 but WordPress 6.x requires at least 7.4 / This plugin requires a newer version of PHP (WordPress)requires at least PHPsendmail: not found (PHP mail) — PHP: sh: 1: /usr/sbin/sendmail: not found — mail() returns false (Email / SMTP)sendmail: not found (…SMTP Error: Could not authenticate — WordPress / PHPMailer: SMTP Error: Could not authenticate / SMTP connect() failed (WordPress)SMTP Error: Could not…PHPMailer

Explore the map of this error Full error map →

🧠 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.