What It Does
Email sending uses @kit/emailer; templating uses @kit/email-templates.
When To Use
- Sending transactional emails.
- Wiring auth email hooks and product notifications.
Prerequisites
- Sender domain and SMTP/API credentials.
Important
This page describes the standard kit integration path; adapt app-specific paths and config names when your project differs.
Available Providers
The @kit/emailer package currently includes these provider implementations:
| Provider | Implementation | Main env var |
|---|---|---|
| Nodemailer (SMTP / sendmail fallback) | kit/email/emailer/src/nodemailer/index.ts | EMAIL_NODEMAILER_URL |
| Postmark | kit/email/emailer/src/postmark/index.ts | EMAIL_POSTMARK_SERVER_TOKEN |
| Resend | kit/email/emailer/src/resend/index.ts | EMAIL_RESEND_API_KEY |
| SendGrid | kit/email/emailer/src/sendgrid/index.ts | EMAIL_SENDGRID_API_KEY |
Current default export
kit/email/emailer/src/index.ts currently exports nodemailer as EmailProvider.
To switch provider, update that export to postmark, resend, or sendgrid.
How To Use
Provider exports
kit/email/emailer/src/index.ts exports the active provider implementation (Nodemailer by default).
Required env vars
EMAIL_FROM="Your App <sender@your-domain.com>"
SUPPORT_EMAIL="support@your-domain.com"
EMAIL_NODEMAILER_URL="smtp://..."
# or provider-specific key variablesSend email
import { EmailProvider } from '@kit/emailer';
import { renderWelcomeEmail } from '@kit/email-templates';
const { html, subject } = await renderWelcomeEmail({
appConfig,
name: 'Jane',
});
await EmailProvider.sendEmail({
to: 'jane@example.com',
from: process.env.EMAIL_FROM!,
subject,
html,
});MCP Context
capability: email_sending
entrypoints:
- kit/email/emailer/src/index.ts
- kit/email/email-templates/src/index.ts
inputs:
- provider_credentials
- template_props
outputs:
- delivered_transactional_email
constraints:
- provider export must match configured credentials
side_effects:
- external email deliveryAgent Recipe
- Pick provider and set credentials.
- Render template from
@kit/email-templates. - Send via
EmailProvider.sendEmail.
Troubleshooting
- Provider auth errors usually indicate wrong credentials or sender domain issues.
- If email format is broken, validate template props.
Related
User Settings
Expose auth-related account controls inside settings pages.
Email Providers
Provider-specific environment configuration.
How is this guide?
Last updated on 3/23/2026