Developer Function: API: Email: Send Email
## Overview
You can send emails using the "「Email Sending API」".
## Supported Versions
#### Attachments
1. Pleasanter 1.2.4.0 or later
1. Pleasanter .NET Framework version 0.50.267 or later
## Preparation
Please create an "[API Key](/en/manual/api-key)" before performing any API operations.
## Request
Send json data in the following request format:
|Setting column|Value|
|:--|:--|
|HTTP Method|POST|
|Content-Type |application/json|
|Character Code|UTF-8|
|URL|http://{server name}/api/items/{record ID}/OutgoingMails/Send (*1)|
|Body|Refer to the json data below|
(*1) Please edit the {server name} and {record ID} parts to suit your environment as appropriate.
For pleasanter.net, the format is as follows:
https\://pleasanter.net/fs/api/items/{record ID}/OutgoingMails/Send
・Required column for json data
|Column|Required|Notes|
|:--|:--|:--|
|ApiVersion|Yes||
|ApiKey|Yes||
|From|-||
|To|-||
|Cc|-||
|Bcc|-||
|Title|Yes||
|Body|-||
|Attachments|-|Please set the following properties. <br>Name: File name<br>Base64: Base64 encoded string of the attachment<br>ContentType: Content type|
##### JSON
```
{
"ApiVersion": 1.1,
"ApiKey": "[Set API Key]",
"From": "[FixedFrom value of Mail.json (*2)]",
"To": "[Recipient email address]",
"Cc": "[Recipient Cc email address]",
"Bcc": "[Recipient Bcc email address]",
"Title": "This is a test of the email sending API.",
"Body": "We are sending an email as a test of the email sending API.",
"Attachments": [
{
"Name": "sample1.txt",
"Base64": "c2FtcGxlMS50eHQ=...",
"ContentType": "text/plain"
},
{
"Name": "sample2.txt",
"Base64": "c2FtcGxlMi50eHQ=...",
"ContentType": "text/plain"
}
]
}
```
(*2) For information about FixedFrom, please refer to [Mail.json](/manual/mail.json).
## Response
The json data in the following format will be returned and the email will be sent.
##### JSON
```
{
"Id": <record ID>,
"StatusCode": 200,
"Message": "Email sent."
}
```
## Reference (Sending HTTP request by Postman)
![image](https://pleasanter.org/binaries/94a0c3a6f77a4f86a7e5cd9e8ccdf484)
(The content-type is set from Headers.)
## Confirmation Column in Case of Error
[・Precautions when using the API and things to check if an error occurs](/manual/faq-api)
[・FAQ: What to check if modified configuration files or API requests (JSON format) are not recognized correctly](/manual/faq-json-format)
## Related Information
<div id="ManualList"><ul><li><a href="/en/manual/api-key">Developer Function: API: Create an API Key</a><span>08.14.2024 up</span></li></ul></article></div><input id="SearchTextHidden" type="hidden" value="" />