From 70d605df9a49a8ed8194355fd20a7713c22acf0d Mon Sep 17 00:00:00 2001 From: tomcat Date: Tue, 15 Oct 2024 23:56:25 +0800 Subject: [PATCH] update --- README.md | 22 +++++++++++++++++----- README_zh.md | 21 +++++++++++++++++---- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6a69514..00aad75 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ 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&recipients=aaa@mail.com,bbb@mail.com' ``` **POST Request Example**: @@ -17,7 +17,7 @@ curl 'http://127.0.0.1:12567/sendMail?token=99eaf30feb23e28057367431d820cf319915 ```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' ``` @@ -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":["aaa@mail.com","bbb@mail.com"] +}' +``` + + **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: diff --git a/README_zh.md b/README_zh.md index 608db40..7349321 100644 --- a/README_zh.md +++ b/README_zh.md @@ -9,7 +9,7 @@ **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&recipients=aaa@mail.com,bbb@mail.com' ``` **POST请求示例**: @@ -17,7 +17,7 @@ curl 'http://127.0.0.1:12567/sendMail?token=99eaf30feb23e28057367431d820cf319915 ```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' ``` @@ -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":["aaa@mail.com","bbb@mail.com"] +}' +``` + **参数说明**: - `token`:在管理界面中手动添加获得,是与SMTP和接收邮箱绑定的唯一值。 - `content`:邮件内容。 - `subject`:邮件主题。如果在生成token时已设置主题,当此参数为空时将使用预设主题。 - `files`:需要发送的附件,支持多个文件。 +- `recipients`:补充的邮箱地址,选填 -**使用方法**: +**安装方法**: 您可以直接从以下链接下载编译好的版本: