Mail & SMTP
Inventorix sends transactional email — password resets, notifications, and warranty-expiry digests — through a configurable mail transport. You can set the transport via environment variables before first boot, and change it at any time through the in-app Settings → Mail screen without restarting workers.
Supported transports
Section titled “Supported transports”| Transport | Identifier | Package / driver |
|---|---|---|
| SMTP | smtp | Laravel built-in |
| Postmark | postmark | symfony/postmark-mailer |
| Resend | resend | resend/resend-php |
| Postal | postal | synergitech/laravel-postal |
| Amazon SES | ses | aws/aws-sdk-php |
| System sendmail | sendmail | Laravel built-in |
| Log (development) | log | Laravel built-in |
Environment variables
Section titled “Environment variables”The mail transport can be bootstrapped with environment variables. These values seed the database settings on first migration; thereafter, the admin UI is the source of truth.
| Variable | Default | Purpose |
|---|---|---|
MAIL_MAILER | log | Active transport identifier (see table above) |
MAIL_HOST | 127.0.0.1 | SMTP host |
MAIL_PORT | 2525 | SMTP port |
MAIL_SCHEME | (null) | smtp (STARTTLS) or smtps (SSL/TLS). Leave unset for plain/auto. |
MAIL_USERNAME | (null) | SMTP username |
MAIL_PASSWORD | (null) | SMTP password |
MAIL_FROM_ADDRESS | hello@example.com | Envelope sender address |
MAIL_FROM_NAME | ${APP_NAME} | Envelope sender name |
POSTMARK_API_KEY and RESEND_API_KEY are not in .env.example — these transport credentials are managed exclusively through the admin Mail settings UI and stored encrypted in the database. |
For SES, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION may be used to bootstrap the initial database row, but at runtime the admin Settings → Mail screen stores dedicated SES credential fields (ses_key, ses_secret, ses_region). ApplySettings applies those dedicated fields to services.ses.{key,secret,region}; the shared storage AWS_* keys are not used for SES at runtime.
In-app mail settings
Section titled “In-app mail settings”Inventorix exposes a Settings → Mail page in the admin panel (/app/settings/manage-mail-settings). Settings saved here are stored encrypted in the database and applied to the Laravel mail runtime on every request and queue job — no worker restart is required.
The database is the source of truth at runtime. Environment variables are read only during the settings migrations that create the initial database rows; afterwards, changes to .env mail keys have no effect while database settings exist.
Accessing the page
Section titled “Accessing the page”Log in to the admin panel and navigate to Settings in the sidebar, then Mail.
Available fields
Section titled “Available fields”From section
- From address — the envelope sender address (e.g.
noreply@yourcompany.com) - From name — the display name shown in email clients
Transport
Select the active driver from the dropdown. The relevant credential fields appear below.
| Driver | Fields shown |
|---|---|
| SMTP | Host, port, encryption scheme, username, password |
| Postal | Domain URL, API key |
| Amazon SES | Access key ID, secret, region |
| Postmark | Server token, message stream ID (optional) |
| Resend | API key |
| Sendmail | (no additional fields) |
| Log | (no additional fields) |
Sending a test email
Section titled “Sending a test email”Click Send test email in the page header. A modal asks for a recipient address (defaults to your own account email). The form is saved first, then a test message is dispatched using the transport you just configured. A green notification confirms delivery; a red persistent notification shows the transport error if delivery fails.
Troubleshooting
Section titled “Troubleshooting”Emails not being sent
- Check that
MAIL_MAILERis notlog— or verify the database setting via Settings → Mail. - For SMTP: confirm the host, port, and credentials. Port 587 with scheme
smtp(STARTTLS) and port 465 with schemesmtps(SSL) are the most common combinations. - Run the in-app test email action and read the error message in the failure notification.
- Check the application log (
storage/logs/laravel.log) for transport exceptions.
Mailer reverts after restart
If you relied on .env variables and previously saved different values through the admin UI, the database settings take precedence. Update the values in Settings → Mail rather than in .env.