Snapmail API

使用Snapmail的API,可以获取到你的邮件内容。您可以在自动化任务中使用它。

所有返回数据都是JSON格式。

你也可以看看 用API从邮件中拿验证码的例子 > >

Endpoints

POST /emailList/filter - 按邮箱获取所有电子邮件。

key and emailAddress 是必需的, 在 我的账户 找到API key。其他的参数是可选的。

isPrefix 让你能从使用这个前缀的邮箱获取邮件,类似howareyou2333@snapmail.cc。

count: 指定邮件的数量,因为有时候你只需要最近的2封邮件

一次最多返回50封电子邮件,您可以通过page选项查询更多。

# 请求示例
POST https://www.snapmail.cc/emailList/filter
Content-Type: application/json

{
  "key": "9a4df3ec-324a-xd3e-12s6-a1f17ca20161",
  "emailAddress": "howareyou@snapmail.cc",
  "isPrefix": true,
  "page": 1,
  "count": 1
}

# 返回结果示例:
[
  {
    'html': '<!DOCTYPE html><html><head></head><body><p>This is a test email.</p></body></html>',
    'text': 'This is a test email.',
    'headers': {
      'content-type': '',
      'from': 'test@snapmail.cc',
      'to': 'test@snapmail.cc',
      'subject': 'test',
      'message-id': '',
      'date': 'Mon, 20 Jan 2024 05:45:22 +0000'
    },
    'subject': 'test',
    'messageId': '',
    'priority': 'normal',
    'from': [{ 'address': 'test@snapmail.cc', 'name': '' }],
    'to': [{ 'address': 'test@snapmail.cc', 'name': '' }],
    'date': '2024-01-20T05:45:22.000Z',
    'id': '256ad5eb-911f-4dde-a2f6',
    'time': '2024-01-20T05:45:25.801Z',
    'timestamp': 1997351925801,
    'envelope': {
      'from': { 'address': 'test@snapmail.cc', 'args': false },
      'to': [{ 'address': 'test@snapmail.cc', 'args': false }]
    },
    'read': false
  }
]

GET /email/:id - 按id获取指定的电子邮件(id需要从/emailList/:box中获取)

# 示例
https://www.snapmail.cc/email/LBmlAa56

GET /email/:id/html - 按id获取电子邮箱的html内容

# 示例
https://www.snapmail.cc/email/LBmlAa56/html

DELETE /email/:id - 按id删除电子邮件

体验Snapmail

返回到博客首页