[metadata]
apple-mobile-web-app-title: Resend
application-name: Resend
description: Start sending emails through the Resend Email API.
generator: Mintlify
msapplication-TileColor: #000000
msapplication-config: /docs/_mintlify/favicons/resend/nAzNk0iRWkZBBJ91/_generated/favicon/browserconfig.xml
og:description: Start sending emails through the Resend Email API.
og:image: https://resend.mintlify.app/_next/image?url=%2F_mintlify%2Fapi%2Fog%3Fdivision%3DSending%26title%3DSend%2BEmail%26description%3DStart%2Bsending%2Bemails%2Bthrough%2Bthe%2BResend%2BEmail%2BAPI.%26logoLight%3Dhttps%253A%252F%252Fmintcdn.com%252Fresend%252Fw4S5Jr48MiquhhSH%252Flogo-black.svg%253Ffit%253Dmax%2526auto%253Dformat%2526n%253Dw4S5Jr48MiquhhSH%2526q%253D85%2526s%253D630be7deea6ea94cc7fc4560ea60a5ac%26logoDark%3Dhttps%253A%252F%252Fmintcdn.com%252Fresend%252Fw4S5Jr48MiquhhSH%252Flogo-white.svg%253Ffit%253Dmax%2526auto%253Dformat%2526n%253Dw4S5Jr48MiquhhSH%2526q%253D85%2526s%253D3843916235739ffb9cb1d24683221341%26primaryColor%3D%2523000000%26lightColor%3D%2523EBECED%26backgroundLight%3D%2523ffffff%26backgroundDark%3D%2523000000&w=1200&q=100
og:image:height: 630
og:image:width: 1200
og:site_name: Resend
og:title: Send Email - Resend
og:type: website
og:url: https://resend.com/docs/api-reference/emails/send-email
twitter:card: summary_large_image
twitter:description: Start sending emails through the Resend Email API.
twitter:image: https://resend.mintlify.app/_next/image?url=%2F_mintlify%2Fapi%2Fog%3Fdivision%3DSending%26title%3DSend%2BEmail%26description%3DStart%2Bsending%2Bemails%2Bthrough%2Bthe%2BResend%2BEmail%2BAPI.%26logoLight%3Dhttps%253A%252F%252Fmintcdn.com%252Fresend%252Fw4S5Jr48MiquhhSH%252Flogo-black.svg%253Ffit%253Dmax%2526auto%253Dformat%2526n%253Dw4S5Jr48MiquhhSH%2526q%253D85%2526s%253D630be7deea6ea94cc7fc4560ea60a5ac%26logoDark%3Dhttps%253A%252F%252Fmintcdn.com%252Fresend%252Fw4S5Jr48MiquhhSH%252Flogo-white.svg%253Ffit%253Dmax%2526auto%253Dformat%2526n%253Dw4S5Jr48MiquhhSH%2526q%253D85%2526s%253D3843916235739ffb9cb1d24683221341%26primaryColor%3D%2523000000%26lightColor%3D%2523EBECED%26backgroundLight%3D%2523ffffff%26backgroundDark%3D%2523000000&w=1200&q=100
twitter:image:height: 630
twitter:image:width: 1200
twitter:title: Send Email - Resend
viewport: width=device-width, initial-scale=1, viewport-fit=cover

[canonical-links]
https://resend.com/docs/api-reference/emails/send-email

[document-links]
/docs/llms.txt: /docs/llms.txt
API Reference: /docs/api-reference/introduction
DEL Delete API key: /docs/api-reference/api-keys/delete-api-key
DEL Delete Audience: /docs/api-reference/audiences/delete-audience
DEL Delete Automation: /docs/api-reference/automations/delete-automation
DEL Delete Broadcast: /docs/api-reference/broadcasts/delete-broadcast
DEL Delete Contact Property: /docs/api-reference/contact-properties/delete-contact-property
DEL Delete Contact Segment: /docs/api-reference/contacts/delete-contact-segment
DEL Delete Contact: /docs/api-reference/contacts/delete-contact
DEL Delete Domain: /docs/api-reference/domains/delete-domain
DEL Delete Event: /docs/api-reference/events/delete-event
DEL Delete Segment: /docs/api-reference/segments/delete-segment
DEL Delete Template: /docs/api-reference/templates/delete-template
DEL Delete Topic: /docs/api-reference/topics/delete-topic
DEL Delete Webhook: /docs/api-reference/webhooks/delete-webhook
DEL Remove Suppression: /docs/api-reference/suppressions/remove-suppression
DEL Revoke Grant: /docs/api-reference/oauth/revoke-grant
Documentation: /docs/introduction
Errors Previous: /docs/api-reference/errors
Errors: /docs/api-reference/errors
GET Authorize: /docs/api-reference/oauth/authorize
GET Get Domain Claim: /docs/api-reference/domains/get-domain-claim
GET Get Template: /docs/api-reference/templates/get-template
GET List API keys: /docs/api-reference/api-keys/list-api-keys
GET List Attachments: /docs/api-reference/emails/list-email-attachments
GET List Attachments: /docs/api-reference/emails/list-received-email-attachments
GET List Attempts BETA: /docs/api-reference/webhooks/list-event-attempts
GET List Audiences: /docs/api-reference/audiences/list-audiences
GET List Automation Runs: /docs/api-reference/automations/list-automation-runs
GET List Automations: /docs/api-reference/automations/list-automations
GET List Broadcasts: /docs/api-reference/broadcasts/list-broadcasts
GET List Contact Imports: /docs/api-reference/contacts/list-contact-imports
GET List Contact Properties: /docs/api-reference/contact-properties/list-contact-properties
GET List Contact Segments: /docs/api-reference/contacts/list-contact-segments
GET List Contacts: /docs/api-reference/contacts/list-contacts
GET List Domains: /docs/api-reference/domains/list-domains
GET List Events BETA: /docs/api-reference/webhooks/list-events
GET List Events: /docs/api-reference/events/list-events
GET List Grants: /docs/api-reference/oauth/list-grants
GET List Logs: /docs/api-reference/logs/list-logs
GET List Received Emails: /docs/api-reference/emails/list-received-emails
GET List Recipients BETA: /docs/api-reference/broadcasts/list-broadcast-recipients
GET List Segment Contacts: /docs/api-reference/segments/list-segment-contacts
GET List Segments: /docs/api-reference/segments/list-segments
GET List Sent Emails: /docs/api-reference/emails/list-emails
GET List Suppressions: /docs/api-reference/suppressions/list-suppressions
GET List Templates: /docs/api-reference/templates/list-templates
GET List Topics: /docs/api-reference/topics/list-topics
GET List Webhooks: /docs/api-reference/webhooks/list-webhooks
GET Retrieve Attachment: /docs/api-reference/emails/retrieve-email-attachment
GET Retrieve Attachment: /docs/api-reference/emails/retrieve-received-email-attachment
GET Retrieve Audience: /docs/api-reference/audiences/get-audience
GET Retrieve Automation Run: /docs/api-reference/automations/get-automation-run
GET Retrieve Automation: /docs/api-reference/automations/get-automation
GET Retrieve Broadcast: /docs/api-reference/broadcasts/get-broadcast
GET Retrieve Contact Import: /docs/api-reference/contacts/get-contact-import
GET Retrieve Contact Property: /docs/api-reference/contact-properties/get-contact-property
GET Retrieve Contact Topics: /docs/api-reference/contacts/get-contact-topics
GET Retrieve Contact: /docs/api-reference/contacts/get-contact
GET Retrieve Domain: /docs/api-reference/domains/get-domain
GET Retrieve Event BETA: /docs/api-reference/webhooks/get-event
GET Retrieve Event: /docs/api-reference/events/get-event
GET Retrieve Log: /docs/api-reference/logs/retrieve-log
GET Retrieve Metrics BETA: /docs/api-reference/broadcasts/get-broadcast-metrics
GET Retrieve Metrics BETA: /docs/api-reference/emails/get-metrics
GET Retrieve Metrics BETA: /docs/api-reference/segments/get-segment-metrics
GET Retrieve Received Email: /docs/api-reference/emails/retrieve-received-email
GET Retrieve Segment: /docs/api-reference/segments/get-segment
GET Retrieve Sent Email: /docs/api-reference/emails/retrieve-email
GET Retrieve Suppression: /docs/api-reference/suppressions/get-suppression
GET Retrieve Topic: /docs/api-reference/topics/get-topic
GET Retrieve Usage: /docs/api-reference/usage/retrieve-usage
GET Retrieve Webhook: /docs/api-reference/webhooks/get-webhook
Get Started: https://resend.com/signup
Guides: /docs/knowledge-base/introduction
Introduction: /docs/api-reference/introduction
Learn more: /docs/dashboard/emails/idempotency-keys
PATCH Update Automation: /docs/api-reference/automations/update-automation
PATCH Update Broadcast: /docs/api-reference/broadcasts/update-broadcast
PATCH Update Contact Property: /docs/api-reference/contact-properties/update-contact-property
PATCH Update Contact Topics: /docs/api-reference/contacts/update-contact-topics
PATCH Update Contact: /docs/api-reference/contacts/update-contact
PATCH Update Domain: /docs/api-reference/domains/update-domain
PATCH Update Email: /docs/api-reference/emails/update-email
PATCH Update Event: /docs/api-reference/events/update-event
PATCH Update Template: /docs/api-reference/templates/update-template
PATCH Update Topic: /docs/api-reference/topics/update-topic
PATCH Update Webhook: /docs/api-reference/webhooks/update-webhook
POST Add Batch Suppressions: /docs/api-reference/suppressions/add-batch-suppressions
POST Add Contact to Segment: /docs/api-reference/contacts/add-contact-to-segment
POST Add Suppression: /docs/api-reference/suppressions/add-suppression
POST Cancel Email: /docs/api-reference/emails/cancel-email
POST Claim Domain: /docs/api-reference/domains/claim-domain
POST Create API key: /docs/api-reference/api-keys/create-api-key
POST Create Audience: /docs/api-reference/audiences/create-audience
POST Create Automation: /docs/api-reference/automations/create-automation
POST Create Broadcast: /docs/api-reference/broadcasts/create-broadcast
POST Create Contact Import: /docs/api-reference/contacts/create-contact-import
POST Create Contact Property: /docs/api-reference/contact-properties/create-contact-property
POST Create Contact: /docs/api-reference/contacts/create-contact
POST Create Domain: /docs/api-reference/domains/create-domain
POST Create Event: /docs/api-reference/events/create-event
POST Create Segment: /docs/api-reference/segments/create-segment
POST Create Template: /docs/api-reference/templates/create-template
POST Create Topic: /docs/api-reference/topics/create-topic
POST Create Webhook: /docs/api-reference/webhooks/create-webhook
POST Duplicate Template: /docs/api-reference/templates/duplicate-template
POST Publish Template: /docs/api-reference/templates/publish-template
POST Register Client: /docs/api-reference/oauth/register
POST Remove Batch Suppressions: /docs/api-reference/suppressions/remove-batch-suppressions
POST Revoke Token: /docs/api-reference/oauth/revoke
POST Send Batch Emails: /docs/api-reference/emails/send-batch-emails
POST Send Broadcast: /docs/api-reference/broadcasts/send-broadcast
POST Send Email: /docs/api-reference/emails/send-email
POST Send Event: /docs/api-reference/events/send-event
POST Stop Automation: /docs/api-reference/automations/stop-automation
POST Token: /docs/api-reference/oauth/token
POST Verify Domain Claim: /docs/api-reference/domains/verify-domain-claim
POST Verify Domain: /docs/api-reference/domains/verify-domain
Pagination: /docs/api-reference/pagination
Resend home page: https://resend.com
See examples: /docs/dashboard/emails/attachments
See examples: /docs/dashboard/emails/tags
Send Batch Emails Next: /docs/api-reference/emails/send-batch-emails
Sending: /docs/api-reference/emails/send-email
Sign In: https://resend.com/login
Usage Limits: /docs/api-reference/rate-limit
errors reference: /docs/api-reference/errors
github: https://github.com/resend
learn more about templates: /docs/dashboard/templates/introduction
website: https://resend.com/
x: https://x.com/resend
youtube: https://www.youtube.com/@resendlabs

[structured-data]
{"@context":"https://schema.org","@graph":[{"@id":"https://resend.com/#organization","@type":"Organization","logo":{"@type":"ImageObject","url":"https://mintcdn.com/resend/w4S5Jr48MiquhhSH/logo-black.svg?fit=max&auto=format&n=w4S5Jr48MiquhhSH&q=85&s=630be7deea6ea94cc7fc4560ea60a5ac"},"name":"Resend","url":"https://resend.com"},{"@id":"https://resend.com/docs#website","@type":"WebSite","name":"Resend","publisher":{"@id":"https://resend.com/#organization"},"url":"https://resend.com/docs"},{"@id":"https://resend.com/docs/api-reference/emails/send-email#webpage","@type":"WebPage","breadcrumb":{"@id":"https://resend.com/docs/api-reference/emails/send-email#breadcrumb"},"dateModified":"2026-07-02T01:37:32.292Z","description":"Start sending emails through the Resend Email API.","isPartOf":{"@id":"https://resend.com/docs#website"},"name":"Send Email","url":"https://resend.com/docs/api-reference/emails/send-email"},{"@id":"https://resend.com/docs/api-reference/emails/send-email#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","item":"https://resend.com/docs","name":"Resend","position":1},{"@type":"ListItem","item":"https://resend.com/docs/api-reference/emails/send-email","name":"Send Email","position":2}]},{"@id":"https://resend.com/docs/api-reference/emails/send-email#apireference","@type":["TechArticle","APIReference"],"dateModified":"2026-07-02T01:37:32.292Z","description":"Start sending emails through the Resend Email API.","headline":"Send Email","isPartOf":{"@id":"https://resend.com/docs#website"},"mainEntityOfPage":{"@id":"https://resend.com/docs/api-reference/emails/send-email#webpage"},"name":"Send Email","publisher":{"@id":"https://resend.com/#organization"},"url":"https://resend.com/docs/api-reference/emails/send-email"}]}

[content]
Send Email - Resend
Documentation Index
Fetch the complete documentation index at:
/docs/llms.txt
Use this file to discover all available pages before exploring further.
Skip to main content
Resend
home page
Documentation
Guides
API Reference
Sign In
Get Started
Get Started
Search...
Navigation
Sending
Send Email
Search...
⌘
K
API Reference
Introduction
Pagination
Usage Limits
Errors
Sending
POST
Send Email
POST
Send Batch Emails
GET
Retrieve Sent Email
GET
List Sent Emails
PATCH
Update Email
POST
Cancel Email
GET
Retrieve Attachment
GET
List Attachments
GET
Retrieve Metrics
BETA
Receiving
GET
Retrieve Received Email
GET
List Received Emails
GET
Retrieve Attachment
GET
List Attachments
Broadcasts
POST
Create Broadcast
POST
Send Broadcast
GET
Retrieve Broadcast
GET
List Broadcasts
PATCH
Update Broadcast
DEL
Delete Broadcast
GET
Retrieve Metrics
BETA
GET
List Recipients
BETA
Automations
POST
Create Automation
PATCH
Update Automation
GET
Retrieve Automation
GET
List Automations
POST
Stop Automation
DEL
Delete Automation
GET
List Automation Runs
GET
Retrieve Automation Run
Events
POST
Create Event
POST
Send Event
GET
Retrieve Event
GET
List Events
PATCH
Update Event
DEL
Delete Event
Templates
POST
Create Template
GET
Get Template
GET
List Templates
PATCH
Update Template
DEL
Delete Template
POST
Publish Template
POST
Duplicate Template
Contacts
POST
Create Contact
GET
Retrieve Contact
GET
List Contacts
PATCH
Update Contact
DEL
Delete Contact
POST
Add Contact to Segment
GET
List Contact Segments
DEL
Delete Contact Segment
GET
Retrieve Contact Topics
PATCH
Update Contact Topics
Contact Properties
POST
Create Contact Property
GET
Retrieve Contact Property
GET
List Contact Properties
PATCH
Update Contact Property
DEL
Delete Contact Property
Contact Imports
POST
Create Contact Import
GET
Retrieve Contact Import
GET
List Contact Imports
Segments
POST
Create Segment
GET
Retrieve Segment
GET
List Segments
DEL
Delete Segment
GET
List Segment Contacts
GET
Retrieve Metrics
BETA
Topics
POST
Create Topic
GET
Retrieve Topic
GET
List Topics
PATCH
Update Topic
DEL
Delete Topic
Audiences
DEPRECATED
POST
Create Audience
GET
Retrieve Audience
GET
List Audiences
DEL
Delete Audience
Domains
POST
Create Domain
POST
Claim Domain
GET
Get Domain Claim
POST
Verify Domain Claim
POST
Verify Domain
GET
Retrieve Domain
GET
List Domains
PATCH
Update Domain
DEL
Delete Domain
Logs
GET
Retrieve Log
GET
List Logs
Usage
BETA
GET
Retrieve Usage
API Keys
POST
Create API key
GET
List API keys
DEL
Delete API key
Suppressions
POST
Add Suppression
GET
Retrieve Suppression
GET
List Suppressions
DEL
Remove Suppression
POST
Add Batch Suppressions
POST
Remove Batch Suppressions
Authorized Apps
GET
List Grants
DEL
Revoke Grant
Webhooks
POST
Create Webhook
GET
Retrieve Webhook
GET
List Webhooks
PATCH
Update Webhook
DEL
Delete Webhook
GET
List Events
BETA
GET
Retrieve Event
BETA
GET
List Attempts
BETA
OAuth
POST
Register Client
GET
Authorize
POST
Token
POST
Revoke Token
Node.js
PHP
Python
Ruby
Go
Rust
Java
.NET
cURL
CLI
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
sent
package
main
import
(
"
context
"
"
fmt
"
"
github.com/resend/resend-go/v3
"
)
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.
*
;
public
class
Main
{
public
static
void
main
(
String
[]
args
) {
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>"
Response
{
"id"
:
"49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}
Sending
Send Email
Copy page
Copy page
Start sending emails through the Resend Email API.
Copy page
Copy page
POST
/
emails
Node.js
PHP
Python
Ruby
Go
Rust
Java
.NET
cURL
CLI
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
sent
package
main
import
(
"
context
"
"
fmt
"
"
github.com/resend/resend-go/v3
"
)
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.
*
;
public
class
Main
{
public
static
void
main
(
String
[]
args
) {
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>"
Response
{
"id"
:
"49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}
​
Body Parameters
​
from
string
required
Sender email address.
To include a friendly name, pass the sender as
Name <email@example.com>
, for example
Acme <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.
​
html
string
The HTML version of the message.
​
text
string
The plain text version of the message.
If not provided, the HTML will be used to generate a plain text version. You can opt out of this behavior by setting value to an empty string.
​
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.
​
attachments
array
Filename and content of attachments (max 40MB per email, after Base64 encoding of the attachments).
See examples
Hide
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 hosted
​
tags
array
Custom data passed in key/value pairs.
See examples
.
Hide
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 a
template
object with:
id
: the id
or
the alias of the published template
variables
: an object with a key for each variable (if applicable)
If a
template
is provided, you cannot send
html
,
text
, or
react
in the payload, otherwise the API will return a validation error.
When sending a template, the payload for
from
,
subject
, and
reply_to
take precedence over the template’s defaults for these fields. If the template does not provide a default value for these fields, you must provide them in the payload.
​
id
string
required
The id of the published email template. Required if
template
is provided. Only published templates can be used when sending emails.
​
variables
object
Template variables object with key/value pairs.
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
.
Hide
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 characters
number
: not greater than 2^53 - 1
​
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
Learn more
Node.js
PHP
Python
Ruby
Go
Rust
Java
.NET
cURL
CLI
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
sent
package
main
import
(
"
context
"
"
fmt
"
"
github.com/resend/resend-go/v3
"
)
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.
*
;
public
class
Main
{
public
static
void
main
(
String
[]
args
) {
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>"
Response
{
"id"
:
"49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}
Was this page helpful?
Yes
No
Errors
Previous
Send Batch Emails
Next
⌘
I
x
github
youtube
website
Assistant
Responses are generated using AI and may contain mistakes.
