Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
PHP Development

Making Sure Your Application's Email Arrives

Last updated:

The default silently fails

PHP's basic mail function hands the message to the local mail system, which typically sends it without proper authentication. Recipient providers discard such messages without a bounce.

The application logs a success, the user is told the message was sent, and nothing arrives. It is the most expensive silent failure in web applications.

What to do instead

  1. Authenticated SMTP through your mail provider, or a transactional email service
  2. Send from a domain you control, with correct authentication records
  3. Put the user's address in reply-to, never in from
  4. Log every send with its outcome
  5. Handle bounces, rather than ignoring them

Domain authentication

  • SPF, listing whatever sends on your behalf
  • DKIM signing, configured with your provider
  • DMARC, starting in monitoring mode
  • All three checked after any change to your sending setup

Those three records are what let receiving providers verify your mail is genuinely yours. Without them, deliverability is a matter of luck.

Separate transactional from marketing

Marketing email affects sender reputation. Sending both from the same domain means a poorly-received campaign can affect delivery of password resets and order confirmations.

A subdomain for marketing keeps the reputations separate, which protects the mail that genuinely matters.

Monitor it

WatchWhy
Send failuresConfiguration has broken
Bounce rateInvalid addresses accumulating
Complaint rateReputation damage
A test send weeklySilent failures are caught in days
Queue depthSending has stopped

Frequently asked questions

Which service should we use?

Your existing mail provider is simplest for low volume. A dedicated transactional service gives better logs and deliverability at scale.

How do we know if email is arriving?

Log every send, monitor bounces, and run an automated weekly test to a real inbox. Assuming is how months of lost mail happen.

Why does our mail go to spam?

Usually missing or incorrect authentication records. Check SPF, DKIM and DMARC first.

Should we queue email?

Yes. Sending during a request makes it slow and makes a provider outage look like an application failure.

Keep reading

Not certain your application's email arrives?

Send yourself one from the live system and check the headers. It is usually revealing.

Book a free 30-minute call Get a project estimate WhatsApp us

Related services

What we build for problems like this one

Web DevelopmentCustom Software Development