Simplifyd Cloud

Sending Emails

Send transactional and marketing emails using the Smail API.

Smail lets you send emails programmatically via a simple REST API. Every email is delivered through your verified sending domain, ensuring proper authentication (SPF, DKIM).

Required fields

FieldDescription
fromSender address — must be on a verified domain
toArray of recipient addresses
subjectEmail subject line
html or textEmail body — at least one is required

Optional fields

FieldDescription
ccCarbon copy recipients
bccBlind carbon copy recipients
reply_toAddress replies are sent to
tagsArray of string tags for filtering in the dashboard
type"transactional" (default) or "marketing"

Code examples

import { SmailClient } from "@smail/smail-js";

const smail = new SmailClient({ apiKey: process.env.SMAIL_API_KEY! });

const { email } = await smail.emails.send({
  from: "noreply@yourdomain.com",
  to: ["user@example.com"],
  subject: "Your order has shipped",
  html: "<p>Your order #1234 is on its way!</p>",
  text: "Your order #1234 is on its way!",
  tags: ["transactional", "order-shipped"],
});
email, err := client.Emails.Send(ctx, smail.SendEmailRequest{
    From:    "noreply@yourdomain.com",
    To:      []string{"user@example.com"},
    Subject: "Your order has shipped",
    HTML:    "<p>Your order #1234 is on its way!</p>",
    Text:    "Your order #1234 is on its way!",
    Tags:    []string{"transactional", "order-shipped"},
})

Email status

After sending, the returned EmailSend object includes a status field. Possible values:

StatusMeaning
queuedEmail accepted and queued for delivery
sentSuccessfully handed off to the mail server
failedDelivery failed