feat: update docs (#204)

* feat: update docs

* feat: update docs
This commit is contained in:
Dream Hunter
2024-05-05 17:45:02 +08:00
committed by GitHub
parent 66a6d40499
commit 9d84eb0634
3 changed files with 21 additions and 2 deletions

View File

@@ -132,6 +132,7 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
items: [
{ text: '配置 SMTP 代理服务', link: 'feature/config-smtp-proxy' },
{ text: '发送邮件 API', link: 'feature/send-mail-api' },
{ text: '查看邮件 API', link: 'feature/mail-api' },
{ text: '配置子域名邮箱', link: 'feature/subdomain' },
]
},

View File

@@ -0,0 +1,18 @@
# 查看邮件 API
## 通过 HTTP API 查看邮件
这是一个 `python` 的例子,使用 `requests` 库查看邮件。
```python
limit = 10
offset = 0
res = requests.post(
f"http://localhost:8787/api/mails?limit={limit}&offset={offset}`;",
json=send_body, headers={
"Authorization": f"Bearer {你的JWT密码}",
# "x-custom-auth": "<你的网站密码>", # 如果启用了自定义密码
"Content-Type": "application/json"
}
)
```

View File

@@ -18,14 +18,14 @@ res = requests.post(
"http://localhost:8787/api/send_mail",
json=send_body, headers={
"Authorization": f"Bearer {你的JWT密码}",
"x-custom-auth": "<你的网站密码>",
# "x-custom-auth": "<你的网站密码>", # 如果启用了自定义密码
"Content-Type": "application/json"
}
)
# 使用 body 验证
send_body = {
"token": "<你的JWT密码>
"token": "<你的JWT密码>",
"from_name": "发件人名字",
"to_name": "收件人名字",
"to_mail": "收件人地址",