Skip to content
  1. Blog

Announcing Acorn Mail

Brandon Nifong Brandon Nifong on

Configuring WordPress with SMTP can often be a headache to reliably get working across environments. SMTP plugins can prove to be unreliable, insecure, and even vulnerable to attacks.

Even despite that, often times testing your SMTP credentials is easier said than done due to poor tooling and little to no error reporting when sending out test mail.

To remedy this, we are introducing Acorn Mail. Acorn Mail aims to streamline SMTP configuration and testing in your WordPress application providing simple configuration and testing using Acorn’s CLI.

Usage

Acorn Mail can be installed alongside Acorn using Composer:

$ composer require roots/acorn-mail

Once installed, simply configure your mail credentials using the following environment variables:

MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME=

When credentials are detected (not empty), Acorn Mail will automatically hook the WordPress PHPMailer instance setting up SMTP.

For advanced configuration, you may publish the mail.php config file:

$ wp acorn mail:publish

Testing

Sending mail can be tested using Acorn’s CLI:

$ wp acorn mail:test [--to=]

This command will allow you to send a test email to the specified address cleanly displaying any errors occurring along the way.

Discuss this post on Roots Discourse

About the author

Brandon Nifong

Brandon is a full-time internet marketer with over 14 years of web development experience. In his free time, he enjoys gaming and traveling with his wife.

Subscribe for updates

Join over 8,000 subscribers on our newsletter to get the latest Roots updates and tips on building better WordPress sites

Looking for WordPress plugin recommendations, the newest modern WordPress projects, and general web development tips and articles?