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.
How it works
Section titled “How it works”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.
Fields
Section titled “Fields”Active mailer
Section titled “Active mailer”| UI label | Setting key | Description |
|---|---|---|
| Active mailer | default_mailer | Which transport to use: smtp, postal, or log. |
| From address | from_address | The envelope and header From: address for all outgoing mail. |
| From name | from_name | The display name paired with the from address. |
SMTP transport (shown when Active mailer = SMTP)
Section titled “SMTP transport (shown when Active mailer = SMTP)”| UI label | Setting key | Description |
|---|---|---|
| Host | smtp_host | SMTP server hostname. |
| Port | smtp_port | TCP port (integer). Common values: 587 for STARTTLS, 465 for implicit TLS, 25 for plain. |
| Username | smtp_username | SMTP authentication username. |
| Password | smtp_password | SMTP authentication password. Stored encrypted; leave blank to keep the current value. |
| Encryption scheme | smtp_scheme | Encryption 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 label | Setting key | Description |
|---|---|---|
| Postal server URL | postal_url | Full URL of your Postal server, e.g. https://postal.example.com. |
| API key | postal_key | Postal API key for the sending credential. Stored encrypted; leave blank to keep the current value. |
Log transport
Section titled “Log transport”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.
Environment defaults
Section titled “Environment defaults”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=logMAIL_SCHEME=nullMAIL_HOST=127.0.0.1MAIL_PORT=2525MAIL_USERNAME=nullMAIL_PASSWORD=nullMAIL_FROM_ADDRESS="hello@example.com"MAIL_FROM_NAME="${APP_NAME}"Sending a test email
Section titled “Sending a test email”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.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Likely 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 address | The from_address / from_name fields override MAIL_FROM_ADDRESS / MAIL_FROM_NAME in env — update them in the UI. |
| Postal delivery failures | Verify the postal_url is reachable from the app container and the postal_key has the correct sending server credentials. |