Published on

How to send email using Resend API


Resend is a startup that is focused on helping developers to send transactional emails easily without them getting ended up in spam.

It has support for various ways to send an email like from serverless environments, REST API call and other supports almost all the major programming languages and frameworks.

And the best part is you can write an email using React itself (if you prefer)

For the sake of simplicity, let's send an email with attachments using their REST API.

The only thing that we need is the API key. You can easily get it from their dashboard


curl -X POST '' \
  -H 'Authorization: Bearer re_YOUR_RESEND_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d $'{
    "from": "",
    "to": "",
    "subject": "Hello World from Curl",
    "text": "It works!"

Node.js using Fetch

npm install node-fetch
import fetch from "node-fetch";


const payload = {
    "from": "",
    "to": "",
    "subject": "Hello World",
    "html": "<p>Congrats on sending your <strong>first email</strong>!</p>"
const requestOptions = {
  method: 'POST',
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${RESEND_AUTH_KEY}`
  body: JSON.stringify(payload)

fetch("", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Happy sending emails!