POST/users/{userId}/mail
Sends a message.
Note
- An email subject can be up to 180 characters in length; if it is longer than that, the excess characters are ignored.
- Before sending a message, the API operation only checks whether the To address is correctly formed; it does not check whether the address is valid (whether it can receive a message, whether it exists, etc.).
- If the address is not valid, "[Message delivery failed]" message is sent to the sender.
- A file of up to 20 MB can be attached. The maximum size of an attachment can be set by the administrator.
- How to attach an inline image
- Add the following tag with "cid: a unique text string" at the location in the message body where the inline image should appear.
<img src="cid:reddotiVBORw0KGgoAAAA" alt=\"Red dot\" />- Base64-encode and add "inline=true, cid=reddotiVBORw0KGgoAAAA" (cid: a unique text string added to the body) and "data= image to attach" to the attachment.
OAuth 2.0 authentication.
For more information, see Authentication and Authorization.
| Parameter | Type | Description |
|---|---|---|
| userId | string | Member ID (must be URL-encoded)
required example : me |
| Header | type | Description |
|---|---|---|
| Authorization | string | Bearer {token} required |
| Content-Type | string | application/json required example : application/json |
| Property | Type | Description |
|---|---|---|
| to | string | Email addresses of to-recipients. Use ';' to add multiple addresses. required minLength : 1 example : admin@example.com; admin1@example.com |
| cc | string | Email addresses of cc-recipients. Use ';' to add multiple addresses. example : admin@example.com; admin1@example.com |
| bcc | string | Email addresses of bcc-recipients. Use ';' to add multiple addresses. example : admin@example.com; admin1@example.com |
| subject | string | Subject required minLength : 1 |
| body | string | Body minLength : 0 |
| contentType | string | Body format
default : html minLength : 1 Allowed values : html, text |
| userName | string | Sender name minLength : 1 |
| isSaveSentMail | boolean | Indicates whether to save the message in Sent.
default : true |
| isSaveTracking | boolean | Indicates whether to save the message in Tracking.
default : true |
| isSendSeparately | boolean | Indicates whether to send an individual message to each recipient.
default : false |
| securityLevel | string | Security level of the message
default : General Allowed values : General, Restricted, Confidential, Non-business |
| attachments | array (object) | Attachment information minItems : 0 |
| Property | Type | Description |
|---|---|---|
| data | string | Attached file data (encoded with Base64) minLength : 1 |
| filename | string | File name minLength : 1 maxLength : 250 |
| fileType | string | File content type minLength : 1 |
| cid | string | Content-ID (must be added when attaching an inline image) |
| inline | boolean | Indicates whether it is an inline image. default : false |
example
1{2 "to": "admin@example.com",3 "subject": "Test",4 "body": "Body",5 "contentType": "html",6 "userName": "admin",7 "isSaveSentMail": true,8 "isSaveTracking": true,9 "isSendSeparately": false,10 "attachments": [11 {12 "filename": "index.html",13 "fileType": "text/html",14 "data": "PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImphIj4KPGhlYWQ+Cjx0aXRsZT5XZWxjb21lIHRvIFdPUktTIEFQSTwvdGl0bGU+CjwvaGVhZD4K PGJvZHk+CjxoMT5XZWxjb21lIFRvIFdPUktTIEFQSTwvaDE+CldlbGNvbWUgdG8gdGhlIFdPUktTIEFQSSB3b3JsZC4KPC9ib2R5Pgo8L2h0bWw+"15 }16 ]17}Accepted
Bad Request
Forbidden
Internal Server Error