Skip to main content

Documentation Index

Fetch the complete documentation index at: https://resend.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Email headers are typically hidden from the end user but are crucial for deliverability. They include information about the sender, receiver, timestamp, and more. Resend already includes all the necessary headers for you, but now you can also add your own custom headers. This is a fairly advanced feature, but it can be useful for a few things:
  • Prevent threading on Gmail with the X-Entity-Ref-ID header (Example)
  • Include a shortcut for users to unsubscribe with the List-Unsubscribe header
Here’s how you can add custom headers to your emails:
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

await resend.emails.send({
  from: 'Acme <onboarding@resend.dev>',
  to: ['delivered@resend.dev'],
  subject: 'hello world',
  html: '<p>it works!</p>',
  headers: {
    'X-Entity-Ref-ID': 'xxx_xxxx',
  },
});