[Node.js SDK]
Next.js
Send transactional email from Next.js App Router and Server Actions with the official Node.js SDK.
Step 1
Install the package
Add the official Node.js client to your Next.js project.
bash
npm install reloop-emailStep 2
Set your API key
Create a free Reloop account, copy your API key, and add it to your Next.js environment.
Get an API key free โbash
RELOOP_API_KEY="re_xxxxxxxx"Step 3
Send email from Next.js
Use this Next.js snippet to send your first message. Works with App Router ยท Server Actions.
send_email.ts
1import Reloop from 'reloop-email';2
3const reloop = new Reloop(process.env.RELOOP_API_KEY);4
5export async function POST() {6 const { data, error } = await reloop.emails.send({7 from: 'Acme <onboarding@yourdomain.com>',8 to: ['delivered@yourdomain.com'],9 subject: 'Hello from Next.js',10 html: '<strong>It works!</strong>',11 });12
13 if (error) {14 return Response.json({ error }, { status: 500 });15 }16
17 return Response.json({ id: data.id });18}Next steps
Examples, docs, and API reference
Go deeper with working code and the full API for Node.js.
Other frameworks
Same API, framework-specific examples.
Send with Next.js.
Get an API key and ship transactional email from Next.js using the official Node.js SDK.