邮件发送API文档
无需认证,直接调用的邮件发送接口
文件大小
2.5 MB
请求参数
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
from |
string | 必需 | 发件人邮箱地址 |
password |
string | 必需 | 发件人邮箱密码 |
to |
string | 必需 | 收件人邮箱,多个用逗号分隔 |
subject |
string | 必需 | 邮件标题 |
content |
string | 必需 | 邮件内容 |
type |
string | 可选 | 邮件类型:plain(默认) 或 html |
代码示例
cURL
curl -X POST \
https://email.uvqzu.cn/send_api.php \
-H 'Content-Type: application/json' \
-d '{
"from": "your_email@uvqzu.cn",
"password": "your_password",
"to": "recipient@example.com",
"subject": "测试邮件",
"content": "这是一封测试邮件"
}'
PHP
<?php
$url = 'https://email.uvqzu.cn/send_api.php';
$data = [
'from' => 'your_email@uvqzu.cn',
'password' => 'your_password',
'to' => 'recipient@example.com',
'subject' => '测试邮件',
'content' => '这是一封测试邮件'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
?>