Send Email

Learn how to send emails programmatically.

import { sendEmail, MagicLink } from "@package/email";

await sendEmail({
  to: "user@example.com",
  subject: "Sign in to your account",
  react: <MagicLink url={magicLinkUrl} />,
});

API Reference

PropertyDescription
fromOptional, defaults to APP_NAME <RESEND_FROM_EMAIL>
toRecipient email address.
subjectEmail subject line.
reactReact Email template component.

@package/email is a server-only package. Never import it in client components or "use client" files.

On this page