Send an Email
Send an email to the specified email address.
Request URL
POST {base_url}/{api_path}/system/sendemail?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| email_server | Yes | String | The email server to send emails. Valid values:
|
| recipient | No | Array<String> | Recipient email address. |
| cc | No | Array<String> | Carbon Copy (CC) email address. |
| bcc | No | Array<String> | Blind Carbon Copy (BCC) email address. |
| subject | No | String | The subject of the email. |
| body | No | String | The body content of the email. |
| attachments | No | Array<String> | Email
attachments. Valid
value: Absolute path to the files stored in the
PBX's local storage. E.g.
|
| force_attach | No | Integer |
Whether emails should be sent only when an attachment is included. Valid value:
|
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| errmsg | String | Returned message.
|
Examples
Request examplePOST /openapi/v1.0/system/sendemail?access_token=n9lRd1ejSkrkc8AukPxYXTUt3wz5p7a2 HTTP/1.1
Host: 192.168.5.150:8088
Content-Type: application/json
{
"email_server": "ys",
"recipient": [
"leo@yeastar.com",
"dave@yeastar.com"
],
"cc": [
"test@yeastar.com"
],
"bcc": [
"demo@yeastar.com"
],
"subject": "API Test",
"body": "This is API Test",
"attachments": [
"/ysdisk/syslog/pbxlog.log"
],
"force_attach": 0
}Response
example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS"
}