| Call | Does |
|---|---|
| create({ address, name }) | Creates a mailbox. |
| list() | Every mailbox of the account. |
| get(id) | One, by identifier or by address. |
| usage() | What the plan allows, before you try. |
| remove(id) | Deletes it. |
| contacts | The address book. |
The order
const domain = await api.domains.get("example.com");
await domain.mail.enable(); // 1. the host's records
const box = await api.mail.create({ address: "hello@example.com", name: "Hello" });
await box.send({ to: "someone@example.net", subject: "Hi", text: "…" });domain = api.domains.get("example.com")
domain.mail.enable() # 1. the host's records
box = api.mail.create(address="hello@example.com", name="Hello")
box.send(to=["someone@example.net"], subject="Hi", text="…")A mailbox cannot exist on a host that has not been enabled: the creation answers mail_not_enabled, naming the host that is missing.
Read the plan before you try
Read it from usage() rather than testing the plan's name — the day the plans change, it is the page that lies. A zero is a limit to show, not a dead end to discover.
Some names are reserved
The addresses a domain is expected to answer for are not available as ordinary mailboxes — they are answered for, and letting anyone take one would break that.
A mailbox has no quota of its own
It consumes the account's object storage, and quotaBytes is that quota. Past it, delivery is refused — except the copy of something you sent, which describes a message already gone.