Remix

Send email from Remix loaders and actions.

Send email from Remix loaders and actions.

Install

npm i resent.one

Set RESENT_API_KEY in your server environment. Keep the key off the client.

Send an email

// app/routes/send.tsx
import { Resent } from "resent.one";
import type { ActionFunctionArgs } from "@remix-run/node";
export async function action({ request }: ActionFunctionArgs) {
const resent = new Resent(process.env.RESENT_API_KEY);
return await resent.emails.send({
from: "Acme <noreply@yourdomain.com>",
to: "you@example.com",
subject: "Hello from Remix",
html: "<strong>It works!</strong>",
});
}

Next steps