AM
ZH-CN
免费开始
菜单
类型

邮件消息

通过系统发送或接收的邮件记录,支持投递追踪。

email message delivery tracking

邮件消息

Email Message 是通过 AM 邮件基础设施发送或接收的邮件记录。

Schema

interface EmailMessage {
  id: string; // "eml_..." - Unique identifier
  account_id: string; // Owning account
  hostname: string; // Sending domain
  direction: "in" | "out"; // Inbound or outbound
  from_contact: EmailContact;
  reply_to_contacts: EmailContact[];
  to_contacts: EmailContact[];
  cc_contacts: EmailContact[];
  bcc_contacts: EmailContact[];
  subject: string;
  body_text: string;
  body_html: string;
  received_at: string | null;
  sent_at: string | null;
}

interface EmailContact {
  email: string;
  name?: string;
}

属性

属性类型说明
idstringeml_ 前缀的 KSUID
account_idstring拥有该消息的账户
hostnamestring发送所用域名
directionenumin 为接收,out 为发送
from_contactobject发件人信息
reply_to_contactsarray回复地址联系人
to_contactsarray主收件人
cc_contactsarray抄送收件人
bcc_contactsarray密送收件人
subjectstring邮件主题
body_textstring纯文本内容
body_htmlstringHTML 内容
received_atstring?入站邮件接收时间
sent_atstring?出站邮件发送时间

示例

{
  "id": "eml_2kHfPZcN9xW4mE8RtY7vB",
  "account_id": "acc_1jGePYbM8wV3lD7QsX6uA",
  "hostname": "mail.example.com",
  "direction": "out",
  "from_contact": {
    "email": "noreply@example.com",
    "name": "Acme Corp"
  },
  "reply_to_contacts": [],
  "to_contacts": [{ "email": "user@example.com", "name": "Jane Doe" }],
  "cc_contacts": [],
  "bcc_contacts": [],
  "subject": "Welcome to Acme",
  "body_text": "Welcome...",
  "body_html": "<h1>Welcome</h1>...",
  "sent_at": "2025-01-15T10:30:00Z"
}

相关