View as Json

Email Service

The Email Service component provides a production-ready solution for sending emails in Servercn using nodemailer, resend and mailtrap.


Installation Guide

npx servercn-cli@latest add email-service

Usage Example

import { sendEmail } from "@/utils/send-mail"
const html = `
  <h1>Reset Your Password</h1>
  <p>Click <a href="https://example.com/reset">here</a> to reset your password.</p>
`;
 
await sendEmail({
  email: "john.doe@example.com",
  subject: "Reset Your Password",
  html,
  from: "Servercn <servercn@example.com>"
});
nodemailer
resend
mailtrap

File & Folder Structure

Loading files...

Installation

npx servercn-cli@latest add email-service