Mail Service Reference
MailService (libs/api/mail/src/lib/mail.service.ts) sends all transactional emails via Nodemailer.
Available Methods
| Method | Subject line | Trigger |
|---|---|---|
sendVerificationEmail(to, url) | Verify your email | Better Auth sign-up |
sendPasswordResetEmail(to, url) | Reset your password | Better Auth password reset |
sendEmailChangeVerification(to, url) | Verify your new email | Not called internally — available for custom use |
sendProfileChangeConfirmation(to, url, newName, newNickname) | Confirm your profile change | request-profile-change |
sendEmailChangeConfirmationToOldEmail(to, url, newEmail) | Confirm your email change | request-email-change (step 1) |
sendEmailChangeVerificationToNewEmail(to, url) | Verify your new email address | request-email-change (step 2) |
sendPasswordChangeConfirmation(to, url) | Confirm your password change | request-password-change |
SMTP Environment Variables
| Variable | Required | Default | Notes |
|---|---|---|---|
SMTP_HOST | ✅ | — | Hostname of the SMTP server |
SMTP_PORT | ❌ | 25 | Integer |
SMTP_SECURE | ❌ | false | Set 'true' to enable TLS |
SMTP_USER | ❌ | — | Omit for anonymous relay |
SMTP_PASS | ❌ | — | Required when SMTP_USER is set |
SMTP_FROM | ✅ | — | Sender address shown in emails |
Local Development
Point SMTP_HOST and SMTP_PORT at a local mail sink (for example smtp4dev). The sink captures all outgoing emails without delivering them. You can then inspect the confirmation links in the sink's UI.
The project's local mail sink API is available at http://127.0.0.1:50463/api.
tip
Use the local smtp4dev instance or the repo mail-sink helper to poll messages and extract confirmation links from HTML email bodies.