Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chuccp committed Oct 15, 2024
1 parent 4a277ff commit 70d605d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Supports GET and POST requests.
**GET Request Example**:

```powershell
curl 'http://127.0.0.1:12567/sendMail?token=99eaf30feb23e28057367431d820cf319915792921d9cf21b5f761fb75433225&content=this%20is%20a%20test'
curl 'http://127.0.0.1:12567/sendMail?token={{token}}&content=this%20is%20a%20test&[email protected],[email protected]'
```

**POST Request Example**:

```powershell
curl -X POST 'http://127.0.0.1:12567/sendMail' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'token=99eaf30feb23e28057367431d820cf319915792921d9cf21b5f761fb75433225' \
--data-urlencode 'token={{token}}' \
--data-urlencode 'content=this%20is%20a%20test'
```

Expand All @@ -27,20 +27,32 @@ curl -X POST 'http://127.0.0.1:12567/sendMail' \
curl -X POST 'http://127.0.0.1:12567/sendMail' \
--form 'files=@"/111111.txt"' \
--form 'files=@"/22222222222222.txt"' \
--form 'token=d6a1ee40c5bad981461643f5404a305a2e3f480cc6fcf65ba98efb63ce32d471"' \
--form 'token={{token}}"' \
--form 'content=1212'
```

This method is essentially a simple form submission, making it easy for different languages and platforms to use this project.

**POST submission json format example**:
```powershell
curl -X POST 'http://127.0.0.1:12567/sendMail' \
--header 'Content-Type: application/json' \
--data '{
"token": "{{token}}",
"content":"this is a test",
"recipients":["[email protected]","[email protected]"]
}'
```


**Parameter Description**:

- `token`: Manually added in the management interface, it is the unique value bound with SMTP and the receiving email address.
- `content`: The content of the email.
- `subject`: The subject of the email. If a subject is set when the token is generated, it will be used as the default subject if this parameter is empty.
- `files`: The attachments to be sent, supports multiple files.
- `recipients`: Supplementary email address, optional.

**Usage Method**:
**Install Method**:

You can directly download the compiled version from the following link:

Expand Down
21 changes: 17 additions & 4 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
**GET请求示例**

```powershell
curl 'http://127.0.0.1:12567/sendMail?token=99eaf30feb23e28057367431d820cf319915792921d9cf21b5f761fb75433225&content=this%20is%20a%20test'
curl 'http://127.0.0.1:12567/sendMail?token={{token}}&content=this%20is%20a%20test&[email protected],[email protected]'
```

**POST请求示例**

```powershell
curl -X POST 'http://127.0.0.1:12567/sendMail' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'token=99eaf30feb23e28057367431d820cf319915792921d9cf21b5f761fb75433225' \
--data-urlencode 'token={{token}}' \
--data-urlencode 'content=this%20is%20a%20test'
```

Expand All @@ -27,20 +27,33 @@ curl -X POST 'http://127.0.0.1:12567/sendMail' \
curl -X POST 'http://127.0.0.1:12567/sendMail' \
--form 'files=@"/111111.txt"' \
--form 'files=@"/22222222222222.txt"' \
--form 'token=d6a1ee40c5bad981461643f5404a305a2e3f480cc6fcf65ba98efb63ce32d471"' \
--form 'token={{token}}"' \
--form 'content=1212'
```

这种方式本质上是简单的表单提交,不同语言和平台都能方便地使用本项目。

**POST提交json格式例子**:

```powershell
curl -X POST 'http://127.0.0.1:12567/sendMail' \
--header 'Content-Type: application/json' \
--data '{
"token": "{{token}}",
"content":"this is a test",
"recipients":["[email protected]","[email protected]"]
}'
```

**参数说明**

- `token`:在管理界面中手动添加获得,是与SMTP和接收邮箱绑定的唯一值。
- `content`:邮件内容。
- `subject`:邮件主题。如果在生成token时已设置主题,当此参数为空时将使用预设主题。
- `files`:需要发送的附件,支持多个文件。
- `recipients`:补充的邮箱地址,选填

**使用方法**
**安装方法**

您可以直接从以下链接下载编译好的版本:

Expand Down

0 comments on commit 70d605d

Please sign in to comment.