Bettermail
    • 获取配置
      GET
    • 获取邮件
      GET
    • 获取邮件
      POST
    • 数据模型
      • ConfigResponse
      • ConfigData
      • MailsRequest
      • ApiEnvelope
      • MailsResponse
      • ErrorResponse
      • MailsData
      • Email
      • Attachment
    GitHub
    孙悟元
    X (Twitter)

      获取邮件

      POST
      /mails
      获取邮件的POST接口,邮件在请求完成后就会从服务端删除,收件地址不需要提前注册。
      如果服务端配置了ALLOW_LIST_ALL为1活着true,则可以不传to,直接获取所有收件地址的邮件。
      公共实例为 邮箱@190823.xyz API地址是https://bettermail-demo.wuyuan.dev,可以直接使用,但需要在项目README中注明链接到 https://x.com/wuyuandev

      请求参数

      Authorization
      Bearer Token
      在 Header 添加参数
      Authorization
      ,其值为在 Bearer 之后拼接 Token
      示例:
      Authorization: Bearer ********************
      or
      API Key
      在 header 添加参数
      X-API-Key
      示例:
      X-API-Key: ********************
      or
      Query 参数

      Body 参数application/json

      示例
      {
          "to": "demo@190823.xyz",
          "limit": 20
      }

      请求示例代码

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      请求示例请求示例
      Shell
      JavaScript
      Java
      Swift
      curl --location 'https://bettermail-demo.wuyuan.dev/mails?token=' \
      --header 'Authorization: Bearer <token>' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "to": "demo@190823.xyz",
          "limit": 20
      }'

      返回响应

      🟢200ok
      application/json
      ok
      Bodyapplication/json

      示例
      {
          "code": 0,
          "message": "ok",
          "data": {
              "list": [
                  {
                      "id": "string",
                      "receivedAt": "2019-08-24T14:15:22.123Z",
                      "from": "string",
                      "to": "string",
                      "subject": "string",
                      "messageId": "string",
                      "date": "string",
                      "text": "string",
                      "html": "string",
                      "headers": {
                          "property1": "string",
                          "property2": "string"
                      },
                      "attachments": [
                          {
                              "filename": "string",
                              "mimeType": "string",
                              "size": 0,
                              "contentId": "string",
                              "contentBase64": "string"
                          }
                      ],
                      "rawBase64": "string",
                      "rawSize": 0
                  }
              ],
              "to": "string",
              "hasMore": true
          }
      }
      🟠401unauthorized
      🟠400mailbox required
      修改于 2026-07-20 09:59:27
      上一页
      获取邮件
      下一页
      ConfigResponse
      Built with