Skip to content

SMTP presets

z4j sends email for invitations and password reset. Configure via env vars.

VarMeaning
Z4J_SMTP_HOSThostname
Z4J_SMTP_PORTusually 587 (STARTTLS) or 465 (SMTPS)
Z4J_SMTP_USERusername
Z4J_SMTP_PASSWORDpassword
Z4J_SMTP_FROMFrom: header (e.g., z4j <noreply@yourdomain>)
Z4J_SMTP_TLSstarttls (default) / ssl / none
Z4J_SMTP_TIMEOUTseconds (default 10)

Gmail requires an app password (not your account password). Enable 2FA, create an app password, and:

Z4J_SMTP_HOST=smtp.gmail.com
Z4J_SMTP_PORT=587
Z4J_SMTP_USER=you@gmail.com
Z4J_SMTP_PASSWORD=xxxx-xxxx-xxxx-xxxx
Z4J_SMTP_FROM=z4j <you@gmail.com>

Gmail OAuth2 integration is on the v1.1 roadmap (SMTP app-password only in v1.0).

Z4J_SMTP_HOST=smtp.mailgun.org
Z4J_SMTP_PORT=587
Z4J_SMTP_USER=postmaster@mg.yourdomain
Z4J_SMTP_PASSWORD=<mailgun smtp password>
Z4J_SMTP_FROM=z4j <noreply@yourdomain>
Z4J_SMTP_HOST=smtp-relay.brevo.com
Z4J_SMTP_PORT=587
Z4J_SMTP_USER=<your brevo smtp login>
Z4J_SMTP_PASSWORD=<your smtp key>
Z4J_SMTP_FROM=z4j <noreply@yourdomain>
Z4J_SMTP_HOST=email-smtp.us-east-1.amazonaws.com
Z4J_SMTP_PORT=587
Z4J_SMTP_USER=<SES SMTP username>
Z4J_SMTP_PASSWORD=<SES SMTP password>
Z4J_SMTP_FROM=z4j <noreply@verified-domain>

SES requires a verified sender domain.

Terminal window
z4j-brain smtp-test --to you@example.com

If the test fails, check brain logs for the SMTP error.

Without SMTP, invite and reset features show the URL in the UI / CLI instead of sending email. Everything still works; just less automated.