You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MailSend/docs/邮件发送服务接口.md

104 lines
24 KiB
Markdown

#### 邮件发送服务接口
3 years ago
###### 请求地址POST http://172.31.85.130:8801/mail/send
3 years ago
**外网测试用POST http://47.104.73.97:8801/mail/send正式运行用上面的内网地址**
###### 请求参数类型JSON
###### 参数说明
| 参数 | 名称 | 类型 | 必填 | 说明 |
| ---------- | ---------------- | -------- | ---- | ---------------------------- |
| SendTo | 接收邮箱 | 字符串 | 是 | 多个接收人以英文逗号隔开 |
| CCTo | 抄送 | 字符串 | 否 | 多个接收人以英文逗号隔开 |
| Title | 邮件标题 | 字符串 | 是 | |
| Body | 邮件正文 | 字符串 | 是 | |
| ShowName | 邮件显示的发送人 | 字符串 | 否 | 不设置则显示发送的邮箱 |
| SmtpConfig | 发送邮箱配置 | 字符串 | 是 | 可选值参考【SmtpConfig选项】 |
| Attaches | 附件列表 | 对象数组 | 否 | 字段参考【Attaches参数说明】 |
| | | | | |
| | | | | |
###### Attaches参数说明
| 参数 | 名称 | 类型 | 必填 | 说明 |
| ------------- | -------- | ------ | ---- | ---------------------- |
| AttachName | 附件名称 | 字符串 | 是 | 在邮件中显示的附件名称 |
| AttachContent | 附件内容 | 字符串 | 是 | 以base64编码的字符串 |
| | | | | |
###### SmtpConfig选项
| SmtpConfig值 | 说明 |
| ------------ | ---------------------------- |
| CANGDAN | dongshengcangdan@h8j.top |
| INVOICE | inv@mail.myshipping.net |
| NOREPLAY | noreplay@mail.myshipping.net |
| SERVICE | service@mail.myshipping.net |
| SPOT | spot@mail.myshipping.net |
| | |
###### 请求参数示例
```
[
{
"SendTo": "wanghaomei@myshipping.net",
"CCTo": "",
"Title": "测试邮件",
"Body": "这个是测试的内容",
"ShowName": "发送大神",
"SmtpConfig": "SERVICE",
"Attaches": [
{
"AttachName": "测试文件.png",
"AttachContent": "iVBORw0KGgoAAAANSUhEUgAAAP8AAABYCAYAAAA6ESGcAAAAAXNSR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73VJoRI1NwySWXoGrVqpicPkXC9uzbi2PHC5GZmYmSJUvixZdfwrgJ4810Bw8fwr4D+4vy8QB/iEJ5xo0bh1mzZp23R7Apx/4Dh2zvWaHbJi8vD9deey2++OILZGdnm3r+2Wef4f7770f3nj2we+8et/TnDKqskaNSpd2nTp9mH0fBUz/v2LEDt9xyC6655hoEBQVh/YY8p/vHjh0z4EVP7KAvj+TnYZ5VygC81XGozPvdjvF6gbkwqAwBjwGXaxiJD3qNxc/Kde+TCzSeX4hyXabjMsvKPvM1yW8pg8eAv4+cKNMInvSzylh8GOS3v/fXQHeUfKo2v+mWm3HRRSUUcUsiKnqQ2Q+eOtQ2XKX57yfVUaJECcE9992L2RlzcP2NN6B9+/Zo1KiRee+OO8vg0OGjgnervIf7/nM/Mucv9Jy3A97uEelTVX9edhkuvvhitG7dFkfOkTdjRcdOXXDtddcjalCMXwapV69eZr1pGEeljcbOXQVibCVctTvb4+ChIxLfro7WsHXrN2JwfCKSh41wwrDhKRiaPNwtfHBCPK4tdZ2UU/KSi9G1Ww+nvH3VoVatWqb8xHWlbjBlZVpNftd0vqAvj27/vhN/YLMiXHDSDMdbfB0ktRv9bcJoALjVR2+AngM9gqsVka8LS8AtzdNwd8dpuLyxY3vPg0dBcFGx88QVsgbBE37OcjqT+R/30g9F2jvvvks6lhZeh7t6JkeOUgE9G638/K244oqrTCW58sorcemllzr95icJ8
}
]
}
]
```
###### 响应说明
| 字段 | 说明 | 类型 |
| ------- | -------- | ------ |
| Success | 是否成功 | 布尔 |
| Code | 代号 | 整数 |
| Message | 说明文本 | 字符串 |
| | | |
###### 正确响应示例
```
{
"Success": true,
"Message": "提交成功",
"Code": 0
}
```
错误响应示例
```
{
"Success": false,
"Message": "接收人不能为空",
"Code": -10
}
```