Prompt

resend api node example

Technology / API Platforms1 observationLast seen Oct 19, 2026

Latest observation

Oct 19, 2026OpenAI APIWeb search: off

Here’s a simple Node.js example for sending an email with the Resend API.

1) Install the SDK

npm install resend

2) Example code

import { Resend } from 'resend';

const resend = new Resend('re_YourApiKeyHere');

async function sendEmail() {
  try {
    const response = await resend.emails.send({
      from: 'Acme <onboarding@resend.dev>', // replace with your verified sender
      to: ['user@example.com'],
      subject: 'Hello from Resend',
      html: '<p>This is a test email sent via Resend.</p>',
    });

    console.log('Email sent:', response);
  } catch (error) {
    console.error('Error sending email:', error);
  }
}

sendEmail();

3) If you're using CommonJS

const { Resend } = require('resend');

const resend = new Resend('re_YourApiKeyHere');

resend.emails.send({
  from: 'Acme <onboarding@resend.dev>',
  to: ['user@example.com'],
  subject: 'Hello from Resend',
  html: '<p>This is a test email sent via Resend.</p>',
}).then((response) => {
  console.log('Email sent:', response);
}).catch((error) => {
  console.error('Error sending email:', error);
});

Notes

  • Replace re_YourApiKeyHere with your actual Resend API key.
  • Make sure the from address is a verified sender in Resend.
  • You can also use text: instead of html: if you want plain text.

If you want, I can also give you:

  • a Next.js API route example
  • a Express route example
  • a TypeScript version

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.