Search by

concept-image / wp-smtp

concept-image

SMTP for Acorn sites, configured from .env with per-environment profiles: Mailpit in development, Ethereal in staging (nothing sent without credentials), a real SMTP server in production (loud alerts when missing). Sender rules that keep plugin senders, debug logging without credentials, a dashboard

Package info

gitlab.com/concept-image-public/wp-smtp

Homepage

Issues

pkg:composer/concept-image/wp-smtp

Statistics

Installs: 2 581

Dependents: 1

Suggesters: 0

Stars: 0

3.0.0 2026-11-30 16:06 UTC

This package is auto-updated.

Last update: 2026-11-30 15:06:47 UTC


README

WP SMTP

Per-environment SMTP for WordPress sites on Acorn

Built for Bedrock + Roots Acorn 6.4. Every wp_mail() is sent over SMTP with settings read from .env only, and each environment gets a safe default:

Environment (WP_ENV)ProfileWith empty variables
development, localMailpitmailpit:1025, no auth, no TLS
stagingEtherealsmtp.ethereal.email:587 STARTTLS with the project's account; nothing is sent without credentials
production (and any other)SMTPno default: PHP mail() with a daily critical log, an admin notice and smtp:status exiting 1

An explicit SMTP_HOST always wins. There is no default credential anywhere.

Requirements

  • PHP 8.3+
  • Roots Acorn 6.4+
  • concept-image/wp-hook-attributes ^0.1 (installed with the package)

Installation

composer require concept-image/wp-smtp

Themes on concept-image/wp-starter-theme already have it.

Configuration

All settings live in the Bedrock .env:

VariableDefault
SMTP_HOSTprofileSMTP server (2.x name SMTP_SERVER still read, deprecated)
SMTP_PORTfrom the encryption, else profileinteger
SMTP_USERNAME / SMTP_PASSWORDnoneSMTP authentication only when the username is set
SMTP_ENCRYPTIONfrom the port (465 ssl, 25/1025 none, else tls)none, tls (STARTTLS) or ssl (2.x name SMTP_SECURE, deprecated)
SMTP_FROMWordPress defaultsender address, validated
SMTP_FROM_NAMEWordPress defaultsender name (2.x name SMTP_NAME, deprecated)
SMTP_FORCE_FROMfalsesend every mail from SMTP_FROM
SMTP_DEBUG0PHPMailer transcript level 1–4, written to the log with credentials redacted

Development (written by igor):

SMTP_HOST=mailpit
SMTP_PORT=1025

Staging: create an account on ethereal.email, then

SMTP_USERNAME=jane.doe12@ethereal.email
SMTP_PASSWORD=the-generated-password
SMTP_FROM=contact@client-domain.fr

Production: the provider's host, port, credentials and a SMTP_FROM on a domain it may send for.

The theme can publish config/smtp.php (wp acorn vendor:publish --tag=wp-smtp-config) to map other environments (environments), switch off the sender rules (sender) or the dashboard widget (widget).

Sender

SMTP_FROM / SMTP_FROM_NAME replace only WordPress' default sender ("WordPress" <wordpress@your-host>): a plugin's sender, such as a Gravity Forms notification, is kept. With SMTP_FORCE_FROM=true every mail leaves from SMTP_FROM and the original sender becomes the Reply-To. The envelope sender (Return-Path) always follows From.

Commands

wp acorn smtp:status            # resolved settings, masked; exit 1 when this environment can't send (deploy check)
wp acorn smtp:test you@example.com   # send a test mail through wp_mail(), print the error

Administrators also get an "E-mails (SMTP)" dashboard widget with the status and a test mail form.

Claude Code

wp acorn vendor:publish --tag=wp-smtp-ai publishes the wp-smtp skill and rules into the Bedrock root's .claude/ (wp-starter-theme's wp acorn starter:ai does it for you).

Upgrading

From 2.x: see UPGRADE.

Changelog

Please refer to CHANGELOG for more information.

Contributing

Please refer to CONTRIBUTING for more information.

License

Please refer to LICENSE for more information.

Credits