Everyone

Emails Not Sending

Fix transactional email delivery problems — SMTP configuration, test emails, and queue issues.

Last updated 1776211200

No Emails Being Sent at All

If no emails are going out (no welcome emails, no invoice emails, no password resets):

Step 1 — Check your .env mail configuration:

MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=noreply@example.com
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@example.com
MAIL_FROM_NAME="My Hosting"

Step 2 — Confirm the queue is running. Emails in Commerce are queued and processed asynchronously. If the queue worker is stopped, emails sit in the jobs table and are never sent.

ps aux | grep "queue:work"

If the queue is not running, start it or restart supervisor. See Queue Not Running.

Test Email Fails

Use the built-in test to isolate SMTP issues:

  1. Go to Admin → Settings → General.
  2. Scroll to Email Settings → Send Test Email.
  3. Enter your email address and click Send.
  4. Watch the page for the result message.

If the test fails, the error message shown will contain the SMTP response. Common failures:

Error Cause
Connection refused Wrong MAIL_HOST or MAIL_PORT, or SMTP server is down
Authentication failed Wrong MAIL_USERNAME or MAIL_PASSWORD
SSL: no alternative certificate Mismatched MAIL_ENCRYPTION (try tls instead of ssl)
Sender address rejected SMTP server is rejecting your From address

Emails Sent But Not Received

If Commerce reports emails were sent successfully but clients don't receive them:

  1. Ask the client to check their spam/junk folder.
  2. Check your domain's SPF and DKIM records:
    • SPF: dig TXT yourdomain.com — verify your SMTP server's IP is included.
    • DKIM: check that your mail server is signing outbound messages and the DNS record is present.
  3. Use mail-tester.com to send a test email and check your spam score and authentication results.

[!TIP] If you're using a shared hosting SMTP relay, ask your provider for the exact SPF record to add. A missing SPF entry causes many legitimate emails to be rejected or junked.

Wrong "From" Address on Emails

The From name and address are set in .env:

MAIL_FROM_ADDRESS=noreply@yourdomain.com
MAIL_FROM_NAME="Acme Hosting"

After changing these values, run:

php artisan config:clear

Config caching can cause old values to persist even after editing .env.

Email Template Renders Blank

If an email arrives but the body is empty or partially empty:

  1. Go to Admin → Settings → Email Templates and open the template.
  2. Check for typos in variable names. A variable like {{ $client_name }} silently renders as empty if the actual variable passed is {{ $clientName }}.
  3. Check the Laravel log for any Undefined variable or Trying to get property of non-object errors that occur at email send time.

Checking the Mail Log

# Show recent mail-related log entries
grep -i "swift\|mail\|smtp\|transport" storage/logs/laravel.log | tail -50

Key error strings to search for:

Log Pattern Meaning
Swift_TransportException SMTP connection or authentication error
Connection refused SMTP server unreachable
stream_socket_client Network-level connection failure
Expected response code 250 SMTP server rejected the message

[!IMPORTANT] If LOG_CHANNEL=single is set in .env, all logs accumulate in one file. For busy installations, this file can grow very large. Rotate it with LOG_CHANNEL=daily which creates one file per day and is much easier to search.