mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-10 17:43:31 +08:00
@@ -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' },
|
||||
]
|
||||
},
|
||||
|
||||
18
vitepress-docs/docs/zh/guide/feature/mail-api.md
Normal file
18
vitepress-docs/docs/zh/guide/feature/mail-api.md
Normal 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"
|
||||
}
|
||||
)
|
||||
```
|
||||
@@ -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": "收件人地址",
|
||||
|
||||
Reference in New Issue
Block a user