# send()

Canonical URL: https://developers.iagenify.com/sdk/ref/mailbox/send/
Language: en

`mailbox.send({ to, cc?, bcc?, subject, text?, html?, attachments?, replyTo?, signature? }) → Promise<Sent>`

Sends from this address, signed with its domain's own key. The answer says which address the recipient will actually see.

Status: POST · the signature is added · accepted is not delivered

```javascript
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 }] }
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `to` | string | string[] | required | Recipients. |
| `cc` | string | string[] |  | Copies. |
| `subject` | string |  | The subject. |
| `text` | string |  | Plain text. |
| `html` | string |  | Or HTML. |
| `replyTo` | string |  | The Message-ID being answered: the copy is filed in that thread. |
| `signature` | boolean |  | `false` sends without the mailbox signature. |
| `bcc` | string | string[] |  | Hidden copies. Only the sender's own copy in the sent folder shows them. |
| `attachments` | object[] |  | `{ 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 {#accepted}

> **The relay hands back when the message is queued**
>
> 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}

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `relay.from` | string |  | **The address the recipient actually sees.** |
| `relay.aligned` | boolean |  | Whether it went out under this mailbox's own domain. |
| `relay.warning` | string|null |  | Why, 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 {#unverified}

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 {#signature}

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 {#cost}

`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.

- [update()](/sdk/ref/mailbox/update): Setting a signature.
- [messages.list()](/sdk/ref/mailbox/messages/list): The sent folder.
- [send_mail](/sdk/agent/tools/send-mail): An agent sending.

```python
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"}]}
```
