POST/users/{userId}/mail
메일을 발송한다.
참고
- 메일 제목은 최대 180자까지 입력할 수 있으며, 180자 이상 입력하면 180자까지만 저장된다.
- 발송 시에 메일 주소의 형식이 맞는지만 확인하고 유효(메일 수신 가능 여부, 실제 존재하는 메일 여부 등)한지는 확인하지 않는다.
- 메일 주소가 유효하지 않으면 발송자에게 "[발송 실패 안내]" 메일이 발송된다.
- 25MB 이하의 일반 파일만 첨부할 수 있다. 일반 파일 첨부 최대 용량은 관리자의 설정에 따라 달라진다.
- 인라인 이미지 첨부 방법
- 메일 본문에 인라인 이미지를 넣고자 하는 위치에 아래 태그를 생성하고 cid:고유한 문자열을 생성하여 추가한다.
<img src="cid:reddotiVBORw0KGgoAAAA" alt=\"Red dot\" />- 첨부 파일에 inline=true, cid=reddotiVBORw0KGgoAAAA (메일본문에 추가한 cid:고유한 문자열), data= 첨부할 이미지를 base64로 인코딩하여 추가한다.
OAuth 2.0 인증.
자세한 인증 방식은 인가·인증를 참고한다.
| Parameter | Type | Description |
|---|---|---|
| userId | string | 구성원 ID (URL인코딩하여 사용)
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 | 받는 사람 메일 주소(구분자: ';'). required minLength : 1 example : admin@example.com; admin1@example.com |
| cc | string | 참조 메일 주소(구분자: ';'). example : admin@example.com; admin1@example.com |
| bcc | string | 숨은 참조 메일 주소(구분자: ';'). example : admin@example.com; admin1@example.com |
| subject | string | 메일 제목 required minLength : 1 |
| body | string | 메일 내용 minLength : 0 |
| contentType | string | 메일 본문 형식
default : html minLength : 1 Allowed values : html, text |
| userName | string | 보내는 사람 이름 minLength : 1 |
| isSaveSentMail | boolean | 보낸메일함에 저장 여부
default : true |
| isSaveTracking | boolean | 수신확인에 저장 여부
default : true |
| isSendSeparately | boolean | 개인별 발송 여부
default : false |
| securityLevel | string | 메일의 보안 등급
default : General Allowed values : General, Restricted, Confidential, Non-business |
| attachments | array (object) | 첨부 파일 정보 minItems : 0 |
| Property | Type | Description |
|---|---|---|
| data | string | 첨부된 파일 데이터(Base64로 인코딩된 데이터) minLength : 1 |
| filename | string | 파일명 minLength : 1 maxLength : 250 |
| fileType | string | 파일 contentType minLength : 1 |
| cid | string | Content-ID (인라인이미지 첨부시 추가해야함) |
| inline | boolean | 인라인 이미지 여부 default : false |
example
1{2 "to": "admin@example.com",3 "subject": "테스트 테스트",4 "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+CjwvaGVhZD4KPGJvZHk+CjxoMT5XZWxjb21lIFRvIFdPUktTIEFQSTwvaDE+CldlbGNvbWUgdG8gdGhlIFdPUktTIEFQSSB3b3JsZC4KPC9ib2R5Pgo8L2h0bWw+"15 }16 ]17}Accepted
Bad Request
Forbidden
Internal Server Error