发送邮件 API
快速发送邮件,支持 GET 和 POST 两种方式
GET 请求示例
https://www.qingye.store/api/sendemail?account=user@example.com&password=123456&fromName=发送者&toEmail=recipient@example.com&subject=邮件主题&content=邮件内容
POST 请求示例
POST https://www.qingye.store/api/sendemail
Content-Type: application/json
{
"account": "user@example.com",
"password": "123456",
"fromName": "发送者",
"toEmail": "recipient@example.com",
"subject": "邮件主题",
"content": "邮件内容"
}
请求参数
| 参数名 |
类型 |
必需 |
说明 |
| account |
string |
GET/POST(API) |
用户账号邮箱 |
| password |
string |
GET/POST(API) |
用户密码 |
| fromName |
string |
GET/POST(前端) |
发件人名称 |
| toEmail |
string |
是 |
收件人邮箱(可用 recipient 替代) |
| recipient |
string |
否 |
收件人邮箱(toEmail 的别名) |
| subject |
string |
是 |
邮件主题 |
| content |
string |
是 |
邮件内容 |
返回示例
成功返回
{
"success": true,
"message": "邮件发送成功",
"data": {
"id": "email_123abc",
"object": "email"
}
}
失败返回 - 参数不完整
{
"success": false,
"message": "参数不完整,必需参数:account, password, fromName, toEmail(或recipient), subject, content"
}
失败返回 - 账号密码错误
{
"success": false,
"message": "账号或密码错误"
}
文本存储 API
文本读写、文件上传下载功能,支持多种操作模式
请求示例
读取文本
https://www.qingye.store/api/text?account=user@example.com&password=123456&mode=r
覆盖写入文本
POST https://www.qingye.store/api/text
Content-Type: application/json
{
"account": "user@example.com",
"password": "123456",
"mode": "w",
"text": "这是要写入的文本内容",
"folderName": "myfolder"
}
上传文件
POST https://www.qingye.store/api/text
Content-Type: multipart/form-data
account: user@example.com
password: 123456
mode: filew
folderName: myfolder
file: [选择文件]
请求参数
| 参数名 |
类型 |
必需 |
说明 |
| account |
string |
是 |
用户账号邮箱 |
| password |
string |
是 |
用户密码 |
| mode |
string |
是 |
操作模式:r/w/cw/aw/filew/filer |
| text |
string |
视模式而定 |
文本内容(w/cw/aw模式必需) |
| filename |
string |
视模式而定 |
文件名(filer模式必需) |
| folderName |
string |
否 |
文件夹名称(可选,默认为根目录) |
操作模式
| 模式 |
说明 |
必需参数 |
| r |
读取文本 |
account, password |
| w |
覆盖写入文本 |
account, password, text |
| cw |
续写文本 |
account, password, text |
| aw |
写入文本开头 |
account, password, text |
| filew |
上传文件(仅POST) |
account, password, file |
| filer |
下载文件(仅GET) |
account, password, filename |
返回示例
成功返回 - 读取文本
{
"status": "success",
"message": "读取成功",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": {
"account": "user@example.com",
"folderName": "myfolder",
"text": "文本内容"
}
}
成功返回 - 写入文本
{
"status": "success",
"message": "覆盖保存成功",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": {
"account": "user@example.com",
"folderName": "myfolder",
"text": "文本内容"
}
}
成功返回 - 上传文件
{
"status": "success",
"message": "文件上传成功!",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": {
"account": "user@example.com",
"folderName": "myfolder",
"fileName": "document.pdf",
"safeFileName": "document.pdf",
"fileSize": 1024000,
"fileSizeFormatted": "1000.00 KB",
"filePath": "/path/to/file",
"mimeType": "application/pdf"
}
}
错误返回 - 参数缺失
{
"status": "error",
"message": "缺少必要参数:account(用户名)、password(密码)或 mode(操作模式)",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": null
}
错误返回 - 认证失败
{
"status": "error",
"message": "用户名或密码错误",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": null
}