Mailing

This page details how to set up and configure mailing in the ZTO SaaS Starter Kit.

This page mainly discusses the mail function in nextjs, if you need to know the mail function of Supabase please learn more in the documentation of Supabase.

There are three providers for mailing in the ZTO SaaS Starter Kit:

  • Resend
  • Nodemailer
  • Cloudflare Email

Configuration

Set up the mailing provider in the .env file. Default is nodemailer.

.env

# Mailing provider (resend/nodemailer/cloudflare)
MAILER_PROVIDER = nodemailer

SMTP configuration:

EMAIL_PORT= # SMTP port
EMAIL_HOST= # SMTP host
EMAIL_TLS=true # Whether to use TLS for email sending
EMAIL_USER= # SMTP username
EMAIL_PASSWORD= # SMTP password

If you use the Resend provider, you need to set up the Resend API key:

RESEND_API_KEY= # Resend API key