Skip to content

Mailer configuration

The Mailer settings screen at /admin/mailer controls how Marketix sends outgoing email — password resets, invitations, and other transactional messages. Settings stored here override the MAIL_* environment defaults at runtime; you do not need to redeploy to change the active transport.

Marketix uses Spatie Laravel Settings to persist mailer configuration in the database under the mail group. On each request the application reads from the database first; the MAIL_* env vars serve as the initial seed and as a fallback if no database row exists yet.

The controller never returns stored secrets to the browser. Instead, the UI shows a placeholder (•••••••• set) when a secret is already saved, and only overwrites it if you type a new value.

UI labelSetting keyDescription
Active mailerdefault_mailerWhich transport to use: smtp, postal, or log.
From addressfrom_addressThe envelope and header From: address for all outgoing mail.
From namefrom_nameThe display name paired with the from address.

SMTP transport (shown when Active mailer = SMTP)

Section titled “SMTP transport (shown when Active mailer = SMTP)”
UI labelSetting keyDescription
Hostsmtp_hostSMTP server hostname.
Portsmtp_portTCP port (integer). Common values: 587 for STARTTLS, 465 for implicit TLS, 25 for plain.
Usernamesmtp_usernameSMTP authentication username.
Passwordsmtp_passwordSMTP authentication password. Stored encrypted; leave blank to keep the current value.
Encryption schemesmtp_schemeEncryption mode string passed to Symfony Mailer, e.g. tls or ssl. Leave blank for no encryption.

Postal transport (shown when Active mailer = Postal)

Section titled “Postal transport (shown when Active mailer = Postal)”

Postal is a self-hosted mail relay supported as a first-class transport.

UI labelSetting keyDescription
Postal server URLpostal_urlFull URL of your Postal server, e.g. https://postal.example.com.
API keypostal_keyPostal API key for the sending credential. Stored encrypted; leave blank to keep the current value.

Select Log (no delivery) to write mail to the application log instead of delivering it. This is the safe default for development or when you want to disable outbound email temporarily.

The MAIL_* env vars in .env serve as defaults when the database settings are empty (fresh install). After you save settings in the UI, the database values take precedence.

MAIL_MAILER=log
MAIL_SCHEME=null
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

Below the settings form is a Send test email section. Enter a recipient address, or leave it blank to send to your own account. Click Send test to dispatch a test message using the currently saved configuration.

The test fires POST /admin/mailer/test with an optional test_email field. If delivery fails, the error message from the mail transport is shown in the flash banner.

SymptomLikely cause
”Test email failed: Connection refused”Wrong host/port or firewall blocking outbound SMTP.
”Test email failed: 535 Authentication failed”Wrong username or password; check that you entered the new password (not left the field blank expecting to inherit).
Emails arrive but show wrong From addressThe from_address / from_name fields override MAIL_FROM_ADDRESS / MAIL_FROM_NAME in env — update them in the UI.
Postal delivery failuresVerify the postal_url is reachable from the app container and the postal_key has the correct sending server credentials.