接口地址:https://api.sendcloud.net/apiv2/mail/send |
---|
返回格式:json |
请求方式:post |
请求示例:https://api.sendcloud.net/apiv2/mail/send?apiUser=&apiKey=&from=&fromName=&to=&subject=&html=&respEmailId= |
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
apiUser | string | 必填 | API_USER 扫码关注公众号 |
apiKey | string | 必填 | API_KEY 扫码关注公众号 |
from | string | 必填 | 发件人地址 |
to | string | 必填 | 收件人地址,多个地址使用';'分隔 |
subject | string | 必填 | 标题,不能为空 |
html | string | 必填 | 邮件的内容. 邮件格式为 text/html |
contentSummary | string | 选填 | 邮件摘要 |
fromName | string | 选填 | 发件人名称 |
cc | string | 选填 | 抄送地址. 多个地址使用';'分隔 |
bcc | string | 选填 | 密送地址. 多个地址使用';'分隔 |
replyTo | string | 选填 | 设置用户默认的回复邮件地址 |
labelName | string | 选填 | 本次发送所使用的标签名称. 若此标签名称在账户不存在,将自动创建 |
headers | string | 选填 | 邮件头部信息. JSON 格式 |
attachments | file | 选填 | 邮件附件. 发送附件时,必须使用 multipart/form-data 进行 post 提交 (表单提交) |
xsmtpapi | string | 选填 | SMTP 扩展字段 |
plain | string | 选填 | 邮件的内容 |
respEmailId | bool | 选填 | 默认值: true. 是选填返回 emailId |
useNotification | bool | 选填 | 默认值: false. 是否使用回执 |
useAddressList | bool | 选填 | 默认值: false. 是否使用地址列表发送 |
sendTime | string | 选填 | 定时发送参数,和地址列表(useAddressList = true)结合使用 |
名称 | 类型 | 说明 |
---|---|---|
- | - | - |
{
"result": true,
"statusCode": 200,
"message": "请求成功",
"info": {
"emailIdList": ["1638511922407_160111_14994_4176.sc-10_9_6_181-inbound0$fangzesheng@free-api.com"]
}
}
错误码 | 说明 |
---|---|
- | - |
<?php
/**
* Created by PhpStorm.
* User: FZS
* Time: 2021/12/03 09:08
*/
$url = 'https://api.sendcloud.net/apiv2/mail/send';
$API_USER = '';
$API_KEY = '';
$param = array(
'apiUser' => $API_USER,
'apiKey' => $API_KEY,
'from' => 'service@sendcloud.im',
'fromName' => '测试邮件',
'to' => 'fangzesheng@free-api.com',
'subject' => '来自免费api的第一封邮件!',
'html' => '你太棒了!你已成功的从免费api发送了一封测试邮件!',
'respEmailId' => 'true');
$data = http_build_query($param);
$options = array(
'http' => array(
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded',
'content' => $data
));
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
}
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
const (
APIURL = "https://api.oick.cn/douyin/api.php?url=https://v.douyin.com/eo1gaGQ/"
)
func main() {
queryUrl := fmt.Sprintf("%s",APIURL)
resp, err := http.Get(queryUrl)
if err != nil {
log.Println(err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}