api.mail

create()

api.mail.create({ address, name }) → Promise<Mailbox>

创建一个已启用的主机邮箱。 配额来自计划, 而不是来自呼叫者 。

POST /api/mailhost must be enabledquota from the plan
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

const box = await api.mail.create({ address: "hello@example.com", name: "Hello" });

box.address;   // "hello@example.com"
box.host;      // "example.com"
box.local;     // "hello"
box = api.mail.create(address="hello@example.com", name="Hello")

box.address   # "hello@example.com"
box.host      # "example.com"
box.local     # "hello"
addressstring必填

完整地址。 其主机必须是启用邮件的地址 。

namestring

显示名称 。

必须先启用主机

import { IaGenifyError } from "iagenify";

try {
  await api.mail.create({ address: "hello@team.example.com" });
} catch (err) {
  if (err instanceof IaGenifyError && err.code === "mail_not_enabled") {
    await domain.mail.enable({ subdomain: "team" });
  }
}
from iagenify import IaGenifyError

try:
    api.mail.create(address="hello@team.example.com")
except IaGenifyError as error:
    if error.code != "mail_not_enabled":
        raise
    domain.mail.enable(subdomain="team")

拒绝者的名字 缺少主机, 所以,固定是 一次呼叫。

打电话者不选择配额

是从计划里出来的,是账户的物品存储

邮箱没有自己的空间。 配额Bytes是账户的, 每次阅读都是新鲜的, 这就是为什么当主机部署某东西或储存充满时邮箱会更充实。

错误

代码状态触发条件
mail_not_enabled403主机还没有邮件记录 。
mail_not_in_plan403该计划没有邮件服务。
address_taken409地址或别名存在
address_reserved400域名要回答 。

内容如下

(更新) 图片和签名, aliases.add() 以其他地址 这片土地在这里, (前) 另请注明副本。