Dhesend

Email

Send Email

Start sending emails through the Dhesend Email API.

import Dhesend from 'dhesend';

const dhesend = new Dhesend('dhe_fdd03c4eb1'); // Replace with your actual API key

(async function () {
    const { data, error } = await dhesend.emails.send({
        from: "Dhesend <example@domain.com>",
        to: ['example@dhesend.com'],
        subject: 'Welcome to Dhesend',
        htmlBody: '<strong>Have a nice day!</strong>',
    });

    if (error) {
        console.error('Failed to send email:', error);
    };

    console.log('Email sent successfully:', data);
})();
{
  "id": "759cd214-98db-40c1-9df4-66d818a51c3a"
}
Endpoint
All emails are sent using this endpoint with POST request.
POST /email/send
Body parameters
fromstringrequired

Sender email address. To include a friendly name, use the formatYour Name <sender@domain.com>

toarrayrequired
Recipient email address. Send as an array of strings. Max 50.
subjectstringrequired
Email subject.
bccarray
Bcc recipient email address. Send as an array of strings.
ccarray
Cc recipient email address. Send as an array of strings.
Reply-to email address. Send as an array of strings.
text_bodystring
The plain text version of the message.
html_bodystring
The HTML version of the message.

Email attachments are limited to a maximum of25 MB per email.You can attach JavaScript File-like objects or use the list format provided below.

Hide properties
urlstring
Url of the attachment
filenamestring
The file name for the attachment. If not provided, it will be derived from the "url" property.
The content type for the attachment. If not provided, it will be derived from the "url".
tagsarray
Custom data passed in key/value pairs.
Hide properties
namestringrequired

Name of the email tag.

Must contain only ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-).

Length must not exceed 256 characters.`

valuestringrequired

Value of the email tag.

Must contain only ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-).

Length must not exceed 256 characters.`

Dhesend @ 2024 - Made with ❤ by  DHEM