PHP mail PHP Origin: Application & API OSI layer 7 · Application Last updated 12 Oct 2026

PHP mail() returns false / emails not delivered

PHP’s mail() function failed or emails never arrive (spam or rejected).

Exact message you may see mail() returns falsePHP mail not workingCould not instantiate mail function
Seen on: PHP

Meaning

mail() only hands the message to the local MTA (sendmail/postfix). Many hosts disable it, and messages without SPF/DKIM from a matching domain are rejected or land in spam.

Common causes

  • No local mail transfer agent
  • Host blocks mail()
  • From address not on your domain
  • Missing SPF/DKIM/DMARC records

⚡ Quick fix

  1. Send via authenticated SMTP (PHPMailer/Symfony Mailer) or a transactional email API
  2. Use a From address on your own domain
  3. Add SPF/DKIM records

Detailed fix by platform

PHP

  1. Check sendmail_path in phpinfo() and the MTA log (/var/log/mail.log)

How to diagnose

  1. Return — Does mail() return false?
  2. Logs — What does the mail log say?
  3. DNS — SPF/DKIM present?

🔧 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: Application & API. Errors that are often confused with or caused by this one (click to open):

1000 — Cloudflare Error 1000: DNS points to prohibited IP (Cloudflare)1000550 5.1.1 — 550 5.1.1 The email account that you tried to reach does not exist (User unknown) (Email / SMTP)550 5.1.1550 5.7.1 — 550 5.7.1 Relaying denied / Message rejected as spam / Unauthenticated email not accepted (Email / SMTP)550 5.7.1550 5.7.26 — 550 5.7.26 This mail has been blocked because the sender is unauthenticated (SPF/DKIM/DMARC) (Email / SMTP)550 5.7.26AADSTS90002 — AADSTS90002: Tenant 'x' not found (Azure)AADSTS90002api_version_invalid — API Error: Invalid or unsupported API version (API)api_version_invalidAzureWebJobsStorage — Azure Functions: Value cannot be null. (Parameter 'connectionString') / Missing value for AzureWebJobsStorage (Azure)AzureWebJobsStorageConnectionString property has not been initialized — InvalidOperationException: The ConnectionString property has not been initialized (.NET)ConnectionString prop…PHP mail

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.