Send Email
Start sending emails through the Resend Email API.
Body Parameters
Section titled “Body Parameters”-
from(string, required) — Sender email address.To include a friendly name, pass the sender as
Name <email@example.com>, for exampleAcme <onboarding@example.dev>. -
to(string | string[], required) — Recipient email address. For multiple addresses, send as an array of strings. Max 50. -
subject(string, required) — Email subject. -
bcc(string | string[]) — Bcc recipient email address. For multiple addresses, send as an array of strings. -
cc(string | string[]) — Cc recipient email address. For multiple addresses, send as an array of strings.
Schedule email to be sent later. The date should be in natural language (e.g.: in 1 min) or ISO 8601 format (e.g:
2026-08-05T11:52:01.858Z).
Reply-to email address. For multiple addresses, send as an array of strings.
-
html(string) — The HTML version of the message. -
text(string) — The plain text version of the message. -
react(React.ReactNode) — The React component used to write the message. Only available in the Node.js SDK. -
headers(object) — Custom headers to add to the email.
The topic ID to receive the email.
- If the recipient is a contact and has opted-in to the topic, the email is sent.
- If the recipient is a contact and has opted-out of the topic, the email is not sent and will be marked as failed.
- If the recipient is not a contact, the email is sent if the topic default subscription value is set to
opt-in.
-
attachments(array) — Filename and content of attachments (max 40MB per email, after Base64 encoding of the attachments).properties
content(buffer | string) — Content of an attached file, passed as a buffer or Base64 string.filename(string) — Name of attached file.path(string) — Path where the attachment file is hostedContent type for the attachment, if not set will be derived from the filename property
You can embed images using the content id parameter for the attachment. To show the image, you need to include the ID in the
srcattribute of theimgtag (e.g.,<img src="cid:...">) of your HTML. Learn about inline images. -
tags(array) — Custom data passed in key/value pairs.properties
name(string, required) — The name of the email tag.It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-).
It can contain no more than 256 characters.
value(string, required) — The value of the email tag.It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-).
It can contain no more than 256 characters.
-
template(object) — To send using a template, provide atemplateobject with:id: the id or the alias of the published templatevariables: an object with a key for each variable (if applicable)
-
id(string, required) — The id of the published email template. Required iftemplateis provided. Only published templates can be used when sending emails. -
variables(object) — Template variables object with key/value pairs.TypeScript variables: { CTA: 'Sign up now', CTA_LINK: 'https://example.com/signup' }When sending the template, the HTML will be parsed. If all the variables used in the template were provided, the email will be sent. If not, the call will throw a validation error.
See the errors reference for more details or learn more about templates.
properties
key(string, required) — The key of the variable.May only contain ASCII letters (a–z, A–Z), numbers (0–9), and underscores (_). The following variable names are reserved and cannot be used:
FIRST_NAME,LAST_NAME,EMAIL,UNSUBSCRIBE_URL.It can contain no more than 50 characters.
value(string | number, required) — The value of the variable.Observe these technical limitations:
string: maximum length of 2,000 charactersnumber: not greater than 2^53 - 1
Headers
Section titled “Headers”-
Idempotency-Key(string) — Add an idempotency key to prevent duplicated emails.- Should be unique per API request
- Idempotency keys expire after 24 hours
- Have a maximum length of 256 characters
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.emails.send({
from: 'Acme <onboarding@resend.dev>',
to: ['delivered@resend.dev'],
subject: 'hello world',
html: '<p>it works!</p>',
});$resend = Resend::client('re_xxxxxxxxx');
$resend->emails->send([
'from' => 'Acme <onboarding@resend.dev>',
'to' => ['delivered@resend.dev'],
'subject' => 'hello world',
'html' => '<p>it works!</p>'
]);import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Emails.SendParams = {
"from": "Acme <onboarding@resend.dev>",
"to": ["delivered@resend.dev"],
"subject": "hello world",
"html": "<p>it works!</p>"
}
email = resend.Emails.send(params)
print(email)require "resend"
Resend.api_key = "re_xxxxxxxxx"
params = {
"from": "Acme <onboarding@resend.dev>",
"to": ["delivered@resend.dev"],
"subject": "hello world",
"html": "<p>it works!</p>"
}
sent = Resend::Emails.send(params)
puts sentpackage main
import (
"context"
"fmt"
"github.com/resend/resend-go/v4"
)
func main() {
ctx := context.TODO()
client := resend.NewClient("re_xxxxxxxxx")
params := &resend.SendEmailRequest{
From: "Acme <onboarding@resend.dev>",
To: []string{"delivered@resend.dev"},
Subject: "hello world",
Html: "<p>it works!</p>",
}
sent, err := client.Emails.SendWithContext(ctx, params)
if err != nil {
panic(err)
}
fmt.Println(sent.Id)
}use resend_rs::types::{CreateEmailBaseOptions};
use resend_rs::{Resend, Result};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let from = "Acme <onboarding@resend.dev>";
let to = ["delivered@resend.dev"];
let subject = "hello world";
let html = "<p>it works!</p>";
let email = CreateEmailBaseOptions::new(from, to, subject)
.with_html(html);
let _email = resend.emails.send(email).await?;
Ok(())
}import com.resend.Resend;
import com.resend.core.exception.ResendException;
import com.resend.services.emails.model.CreateEmailOptions;
import com.resend.services.emails.model.CreateEmailResponse;
public class Main {
public static void main(String[] args) throws ResendException {
Resend resend = new Resend("re_xxxxxxxxx");
CreateEmailOptions params = CreateEmailOptions.builder()
.from("Acme <onboarding@resend.dev>")
.to("delivered@resend.dev")
.subject("hello world")
.html("<p>it works!</p>")
.build();
CreateEmailResponse data = resend.emails().send(params);
}
}using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
var resp = await resend.EmailSendAsync( new EmailMessage()
{
From = "Acme <onboarding@resend.dev>",
To = "delivered@resend.dev",
Subject = "hello world",
HtmlBody = "<p>it works!</p>",
} );
Console.WriteLine( "Email Id={0}", resp.Content );curl -X POST 'https://api.resend.com/emails' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"from": "Acme <onboarding@resend.dev>",
"to": ["delivered@resend.dev"],
"subject": "hello world",
"html": "<p>it works!</p>"
}'resend emails send \
--from "Acme <onboarding@resend.dev>" \
--to delivered@resend.dev \
--subject "hello world" \
--html "<p>it works!</p>"{
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}