Mail configuration priority

I am curious to know how October CMS knows whether to use the mail config from the back-end (database) or to use the config that’s in your .env file. Does one take priority over the other?

October CMS will use mail configuration from the database first, then use the file-based configuration (.env / config file) as a fallback option. If the database configuration is reset via Settings → Mail Configuration, it will always use the file-based configuration. The database configuration will only apply once that form is saved for the first time.

I can’t seem to be able to make the .env file working for the mail configuration.
it always used the database configuration.
when I click ‘reset configuration’ the settings shows up with partial smtp settings

There is a new setting for forcing the mail configuration (taken from config/backend.php in v3):

/*
|--------------------------------------------------------------------------
| Force Mail Setting
|--------------------------------------------------------------------------
|
| Use this setting to remove the option to configure the mail settings
| via the backend. This can be used in developer environments to prevent
| accidentally sending mail via the configured database.
|
*/

'force_mail_setting' => false,
2 Likes