All guides

Send Email from Remix

Send transactional emails from your Remix application

1. Install the SDK

npm install sendpigeon

2. Set your API key

Add your SendPigeon API key to your environment variables:

SENDPIGEON_API_KEY=your_api_key_here

Get your API key from the dashboard.

3. Send your first email

// app/routes/contact.tsx
import type { ActionFunctionArgs } from "@remix-run/node";
import { SendPigeon } from "sendpigeon";

const client = new SendPigeon(process.env.SENDPIGEON_API_KEY!);

export async function action({ request }: ActionFunctionArgs) {
  const formData = await request.formData();
  const email = formData.get("email") as string;
  const name = formData.get("name") as string;

  await client.emails.send({
    from: "hello@yourdomain.com",
    to: email,
    subject: `Thanks for reaching out, ${name}!`,
    html: `<h1>We got your message</h1><p>We'll get back to you soon.</p>`,
  });

  return { success: true };
}

Features

  • Works in Remix action functions
  • Full TypeScript support
  • Deploy to Vercel, Fly.io, or any Node.js host

Ready to send emails?

Get started with 1,000 free emails per month.

Start for free