How to configure Acorn Mail in Sage 11?

I’m using Sage v11. What’s the correct way to set up and configure roots/acorn-mail in Sage 11? Where should the mail configuration live within the Sage 11 theme structure, and do I need to register any service provider manually or does it work out of the box? Also, what’s the recommended way to verify the SMTP setup from the CLI?

Thanks!

The README has installation, getting started, and usage instructions that address all of your questions: https://github.com/roots/acorn-mail

Have you tried installing it and publishing the config?

Yes, I installed it and published the config. The issue was my local environment using http://localhost. WordPress builds the default From as wordpress@localhost and wp_mail() validates that From before phpmailer_init runs (which is where Acorn Mail applies the .env settings). Since wordpress@localhost isn’t a valid address, PHPMailer failed before Acorn Mail could set the config, so the .env values were never applied.

The fix was to use a valid local domain (e.g. http://local.test) or pre-set a valid From via the wp_mail_from/wp_mail_from_name filters. Once the From was valid, the Acorn Mail test picked up the config and worked fine.

Thanks a lot!

1 Like