To be able to send emails to your users, you will need an SMTP server. In this page, we will see how to setup yours.
This feature is implemented with the @kit/emailer package.
Setup
To know
We assume that you will use the same SMTP server for all your applications.
For that reason, we do not use an email config object approach.
You need to have a domain name to set your SMTP server.
The first thing to to is choose which SMTP provider you will use.
Click on one of the available providers to see how to setup the associated env variable :
Set the following environment variables :
EMAIL_FROM="Your Organization Name <sender-address@your-domain.com>"
SUPPORT_EMAIL="support@your-domain.com"Now go to : @kit/emailer/src/index.ts and uncomment the provider you want to use only.
export { default as EmailProvider } from './nodemailer';
// export { default as EmailProvider } from './postmark';
// export { default as EmailProvider } from './resend';
// export { default as EmailProvider } from './sendgrid';Supabase
When you deploy your project, you must provide your SMTP server details to Supabase.
No needs to do it in local environment (not supported yet). Supabase provide an "in bucket" port for showing what would be sent in email. Go to http://localhost:54324/ to see the sent emails.
The complete process is described in this Supabase documentation page.
But all you need to do is :
Go to your Supabase dashboard.
Go to : Your project > Authentication > Emails.
Click on the SMTP Settings tab.
Enable Enable Custom SMTP and fill the form with your SMTP server details.
Usage
Make sure that the @kit/emailer and @kit/email-templates packages are installed.
Now you can use the EmailProvider class to send emails.
// import your template import { renderUserDeleteEmail } from '@kit/email-templates'; import { EmailProvider } from '@kit/emailer'; async function sendEmail() { const { html, subject } = await renderUserDeleteEmail({ var1: 'value1', var2: 'value2', // ... }); return EmailProvider.sendEmail({ to: userEmail, // the email address of the recipient from: fromEmail, // the email address of the sender subject, html, }); }
Environment variables
# ============================================
# 📧 EMAIL PROVIDERS
# ============================================
# Email sender configuration
EMAIL_FROM="Your Organization Name <sender@your-domain.com>"
SUPPORT_EMAIL="support@your-domain.com"
# Alternative providers
EMAIL_NODEMAILER_URL=""
EMAIL_POSTMARK_SERVER_TOKEN="" # Get from: Postmark > API Tokens
EMAIL_RESEND_API_KEY="" # Get from: Resend > API Keys
EMAIL_SENDGRID_API_KEY="" # Get from: SendGrid > Settings > API KeysProtect your app from spam with Cloudflare Turnstile CAPTCHA
Setup the SMTP provider you want to use.
How is this guide?
Last updated on 10/17/2025