接口路径(新):http://api.okayapi.com/api/App/Email/Send
接口路径(旧):http://api.okayapi.com/?s=App.Email.Send
接口描述: 发送邮件到指定的邮箱,支持发送附件。使用前需要先在小白开放平台配置邮箱服务。
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
address | ArraySeperated with ; | Required | 收件人邮件地址,多个用英文分号隔开 | ||
title | String | Required | 邮件标题 | ||
content | String | Required | 邮件内容,使用UTF8编码、HTML格式 | ||
CC | ArraySeperated with ; | Optaion | 添加抄送,多个用英文分号隔开 | ||
BCC | ArraySeperated with ; | Optaion | 添加密送,多个用英文分号隔开 | ||
configuration | String | Optaion | 邮件配置名称,在小白开放平台-邮件服务配置中添加的名称,不传则使用默认配置 | ||
attachments | ArrayJSON Format | Optaion | [] | 附件,支持多个附件。每一组格式如下:
attachments=[{"name":"文本.txt","data":"这是附件里的文本内容"}] | |
email_sender | String | Optaion | 发件人 |
请求:
{OKAYAPI_API_HOST}/?s=App.Email.Send&address=xx@okayapi.com&title=测试邮件&content=test123456789&app_key={你的app_key}&sign={动态签名}
返回:
{
"ret": 200,
"data": {
"err_code": 0,
"err_msg": ""
},
"msg": ""
}
如果需要发送附件,可以这样请求:
{OKAYAPI_API_HOST}/?s=App.Email.Send&address=xxx@qq.com&title=小白开放平台更新公告&content=小白开放平台更新公告,测试带附件&attachments=[{"name":"文本.txt","data":"这是附件里的文本内容"}]
如果需要发送url图片作为附件,示例如下:
{OKAYAPI_API_HOST}/?s=App.Email.Send&address=xxx@qq.com&title=测试小白图片附件发送&content=测试小白图片附件发送&configuration=email_yesapi&attachments=[{"name":"20200719205142.png","data":"http:\/\/api.orbbec.com.cn/uploads\/forum\/20200719205142.png","encoding":"url"}]
收到的邮件及附件,截图如下:
http://cdn7.okayapi.com/yesyesapi_20200812103907_42705ac3f60105a5ae36bf37152b5714.png
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示发送成功,1表示发送失败,失败原因可查看小白开放平台的日志 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
接口路径(新):http://api.okayapi.com/api/App/Email/SendCaptcha
接口路径(旧):http://api.okayapi.com/?s=App.Email.SendCaptcha
接口描述: 发送一个动态验证码到指定邮箱,重复发送时,以最后一次发送的验证码为准。使用前,可进入小白开放平台-邮箱验证码配置进行设置。不管成功与否,都能在小白开放平台查看验证码发送日志。
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
address | String | Required | 邮件地址 |
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示发送成功,1表示发送失败,失败原因可查看小白开放平台的日志 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
接口路径(新):http://api.okayapi.com/api/App/Email/VerifyCaptcha
接口路径(旧):http://api.okayapi.com/?s=App.Email.VerifyCaptcha
接口描述: 对已经发送的邮箱验证码进行校验,如果验证码不存在,已过期,不正确,或已经成功验证过,将校验失败。
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
address | String | Required | 邮件地址 | ||
captcha | String | Required | 待校对的动态邮箱验证码 |
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示校对成功,1表示校对失败 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
Power by OkayAPI.com Contact us (WA: okayapi OR Email: chanzonghuang@gmail.com).
Timezone: America/New_York May/09/2025 08:03:56