const sent = await box.send({
to: ["someone@example.net"],
bcc: ["accounting@example.com"],
subject: "Your invoice",
html: '<h1>Thank you</h1><img src="cid:logo">',
text: "Thank you", // plain-text fallback
attachments: [
{ filename: "invoice.pdf", content: pdfBytes, contentType: "application/pdf" },
{ filename: "logo.png", content: logoBytes, cid: "logo" }, // shown inside the HTML
{ filename: "quote.pdf", path: "./quote.pdf" }, // Node only
],
});
// { id, relay: { name, from, aligned, warning }, credits,
// attachments: [{ filename, size, contentType, inline }] }sent = box.send(
to=["someone@example.net"],
bcc=["accounting@example.com"],
subject="Your invoice",
html='<h1>Thank you</h1><img src="cid:logo">',
text="Thank you", # plain-text fallback
attachments=[
{"filename": "invoice.pdf", "content": pdf_bytes, "content_type": "application/pdf"},
{"filename": "logo.png", "content": logo_bytes, "cid": "logo"}, # shown inside the HTML
{"path": "quote.pdf"},
],
)
# {"id", "relay": {"name", "from", "aligned", "warning"}, "credits",
# "attachments": [{"filename", "size", "contentType", "inline"}]}tostring | string[]requiredRecipients.
ccstring | string[]Copies.
subjectstringThe subject.
textstringPlain text.
htmlstringOr HTML.
replyTostringThe Message-ID being answered: the copy is filed in that thread.
signaturebooleanfalse sends without the mailbox signature.
bccstring | string[]Hidden copies. Only the sender's own copy in the sent folder shows them.
attachmentsobject[]{ filename, content, contentType?, cid? } or { path } in Node. content: bytes, a Blob, or a string (UTF-8 text, or base64 with encoding: "base64"). A cid shows the file inside the HTML as <img src="cid:…">. 25 MB in all, 20 files at most; executables are refused, because Gmail and Outlook reject the whole message for them.
Accepted is not delivered
What happens after that is not told to us. Reporting « sent » to a person means it was accepted — true, and not the same thing. The id is the copy filed in the sent folder, so a send can be read back.
relay says which address is really visible
relay.fromstringThe address the recipient actually sees.
relay.alignedbooleanWhether it went out under this mailbox's own domain.
relay.warningstring|nullWhy, when it did not.
A message arriving under a name the customer did not choose, with nothing saying so, reads as a fault. The fields exist so it can be said.
An unverified host is refused
Rather than going out under some other address. A refusal is repairable — verify the domain — where a borrowed sender is the white-label promise collapsing, and to a filter it looks like a hijack.
The signature is added
If the mailbox has one. With an image it travels inside the message, so it shows without « load remote images » — the only way a picture reliably reaches a recipient.
A text-only send with a signature becomes a message with both parts; an HTML-only send is not given an invented text part that would carry the signature alone.
What it costs
credits is zero while the plan covers the send. A credit taken before the relay call is given back in full if the relay refuses.