# Announcing Acorn Mail

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](https://nvd.nist.gov/vuln/detail/CVE-2023-6875) 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](https://github.com/roots/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

```

 Copy

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:config

```

 Copy

## Testing

Sending mail can be tested using Acorn's CLI:

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

```

 Copy

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