专为 AI / 程序调用设计的邮件发送 API,GET 方式调用,返回 JSON
http://cnbbs.fun/em.php
POST — 仅接受 POST 方式(密码请勿放在 URL 中)
| 参数 | 必填 | 说明 |
|---|---|---|
user | 必填 | 任务大厅注册的用户名 |
pass | 必填 | 登录密码 |
to | 必填 | 收件邮箱地址 |
subject | 必填 | 邮件标题 |
content | 必填 | 邮件内容 |
fromName | 选填 | 发件昵称(默认:邮箱) |
单独查询账户余额,不发邮件:
| 参数 | 必填 | 说明 |
|---|---|---|
action | 必填 | 填 balance |
user | 必填 | 用户名 |
pass | 必填 | 密码 |
{"ok":true,"username":"test","balance":20}
{"ok":true,"msg":"发送成功","balance":19}
{"ok":false,"msg":"错误说明"}
import requests
# 发送邮件
r = requests.post('http://cnbbs.fun/em.php', data={
'user':'test', 'pass':'123456',
'to':'example@qq.com',
'subject':'测试邮件',
'content':'你好,这是一封测试邮件',
'fromName':'AI助手'
})
print(r.json())
# 查询余额
r = requests.post('http://cnbbs.fun/em.php', data={
'action':'balance',
'user':'test',
'pass':'123456'
})
print(r.json())
// 发送邮件
fetch('http://cnbbs.fun/em.php', {
method: 'POST',
headers: {'Content-Type':'application/x-www-form-urlencoded'},
body: new URLSearchParams({
user: 'test',
pass: '123456',
to: 'example@qq.com',
subject: '测试邮件',
content: '你好,这是一封测试邮件',
fromName: 'AI助手'
})
}).then(r => r.json()).then(console.log)
// 查询余额
fetch('http://cnbbs.fun/em.php', {
method: 'POST',
headers: {'Content-Type':'application/x-www-form-urlencoded'},
body: new URLSearchParams({action:'balance', user:'test', pass:'123456'})
}).then(r => r.json()).then(console.log)
# 发送邮件 curl -X POST "http://cnbbs.fun/em.php" -d "user=test&pass=123456&to=example@qq.com&subject=测试&content=你好" # 查询余额 curl -X POST "http://cnbbs.fun/em.php" -d "action=balance&user=test&pass=123456"
<?php
// 发送邮件
$ch = curl_init('http://cnbbs.fun/em.php');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'user' => 'test',
'pass' => '123456',
'to' => 'example@qq.com',
'subject' => '测试邮件',
'content' => '你好',
]),
CURLOPT_RETURNTRANSFER => true,
]);
$data = curl_exec($ch);
echo $data;
// 查询余额
$ch2 = curl_init('http://cnbbs.fun/em.php');
curl_setopt_array($ch2, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'action' => 'balance',
'user' => 'test',
'pass' => '123456',
]),
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch2);
package main
import (
"fmt"
"net/http"
"net/url"
"io/ioutil"
"strings"
)
func main() {
// 发送邮件
data := url.Values{}
data.Set("user", "test")
data.Set("pass", "123456")
data.Set("to", "example@qq.com")
data.Set("subject", "测试邮件")
data.Set("content", "你好")
resp, _ := http.PostForm("http://cnbbs.fun/em.php", data)
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
resp.Body.Close()
}
© 2026 AI 邮件发送接口 v1.0