Developer Guides

Laravel SMTP Configuration Errors: MAIL_SCHEME, Ports, and the sdp Mailer

Fix Laravel SMTP configuration errors: valid MAIL_SCHEME values, port and TLS mismatches, cached config, and why Arawa Mail apps should use the sdp mailer.

Published

Published by Arawa Mail.

Laravel SMTP configuration errors diagram showing MAIL_SCHEME and sdp mailer

A Laravel application on Arawa Mail should not use SMTP for application sending. Set MAIL_MAILER=sdp and SDP_EMAIL_KEY. SMTP port 465 with a mailbox password is only the device path for email clients, not the documented app path. Most “SMTP will not connect” tickets after moving to the newer Laravel mail config are a MAIL_SCHEME/port mismatch or a cached configuration that the queue worker never reloaded.

Check MAIL_MAILER before you touch ports

The documented Arawa Mail path for Laravel is the HTTP API mailer, not SMTP. Install composer require sharasolns/sdp-email, set MAIL_MAILER=sdp and SDP_EMAIL_KEY, and ensure MAIL_FROM_ADDRESS uses a domain with outbound sending active. You do not edit config/mail.php for this path. If Laravel still uses the old mailer, run php artisan config:clear (or config:cache after confirming the .env). See the full happy path in our Send email in Laravel guide.

SMTP 465 with SSL/TLS, username as the full address, and the mailbox password appears only in the Connect Device guide for desktop/mobile clients. Docs use placeholder hosts (smtp.example.com). Do not paste the mailbox password into MAIL_PASSWORD for an application.

What replaced MAIL_ENCRYPTION? The scheme/port mismatch

The Laravel application skeleton swapped MAIL_ENCRYPTION for MAIL_SCHEME in December 2024, during the Laravel 11 cycle, and Laravel 12 and 13 ship the same config/mail.php. The default SMTP mailer no longer reads MAIL_ENCRYPTION at all. MAIL_SCHEME accepts only smtp or smtps, because those are the only schemes Symfony Mailer's SMTP transport supports. When it is null, Laravel picks smtps for port 465 and smtp for any other port, and with smtp Symfony upgrades the connection with STARTTLS when the server offers it. Carrying an old value across, such as MAIL_SCHEME=tls, throws Symfony's unsupported-scheme error.

Port and encryption must match:

  • 587 + STARTTLS (scheme null or smtp) — usual submission pair.
  • 465 + implicit TLS (scheme smtps, or null, which Laravel resolves to smtps on 465) — not a STARTTLS upgrade.
  • Port 25 is often blocked by hosts and is not the Arawa device port.

For deeper port and TLS mechanics see SMTP ports 25, 465, and 587 and STARTTLS vs implicit TLS.

Why a fixed .env still fails in production

Configuration is cached. Queue workers boot the config once. A correct .env still fails if php artisan queue:work was started before the change. After config:clear (or config:cache), restart the workers. Do not infer delivery from a Laravel send call that only reached the provider. For queue specifics link to Queue Laravel mailables with ShouldQueue.

Common SMTP failures (illustrative)

  • Connection refused — port/scheme mismatch.
  • 530 5.7.0 authentication required — bad username or password (or using mailbox credentials on the wrong path).
  • Mail that appears to succeed because MAIL_MAILER is still log or array.

Arawa Mail rejects sending when the domain is unregistered, outbound sending is inactive, the key lacks the sending scope, or a domain-restricted key excludes the domain.

How we analyzed this

We cross-checked the current Arawa Mail Laravel quickstart (MAIL_MAILER=sdp, no SMTP for apps), the Connect Device guide (placeholder SMTP 465 for clients only), the Laravel mail documentation, the Laravel framework source for how a null scheme is resolved, and Symfony Mailer's supported SMTP schemes. The 530 reply follows RFC 4954 (530 5.7.0 Authentication required). We did not invent Arawa SMTP error codes or production hostnames.

FAQ

Should a Laravel app on Arawa Mail use SMTP at all?

No. Use the sdp mailer and API key. SMTP 465 is the device/client path only.

What replaced MAIL_ENCRYPTION?

MAIL_SCHEME (smtp or smtps). When null, Laravel uses smtps on port 465 and smtp (with STARTTLS when offered) on other ports.

Which port pairs with smtps versus STARTTLS?

smtps with 465 (implicit TLS); STARTTLS with 587.

Why does a fixed .env still fail?

Cached config and queue workers that have not been restarted.

What does 530 5.7.0 usually mean?

Authentication required — wrong credentials or using the mailbox password on an application path.

Related reading: SMTP vs email API, Laravel Mail::raw.

Simple, transparent plans

Start free. Grow when your email does.

Get one domain, API access and 3,000 transactional emails every month at no cost.

Compare plans