Skip to content

Send Email

Overview

You can send emails using the "Email Sending API".

Either the email address of the API key's user or SupportFrom in "Mail.json" must be set.

Cautions

  1. Pleasanter versions 1.5.0.0 to 1.5.2.0 have a bug that corrupts attached files. This bug has been fixed in version 1.5.3.0. If you send emails with attachments, do not use Pleasanter versions 1.5.0.0 to 1.5.2.0.

Preparations

Please create an "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

Required Columns for JSON Data

Column Required Notes
ApiVersion Yes
ApiKey Yes
From -
To -
Cc -
Bcc -
Title Yes
Body -
Attachments - Please set the following properties.
Name: File name
Base64: Base64 encoded string of the attachment
ContentType: Content type
Request Sample
{
     "ApiVersion": 1.1,
     "ApiKey": "[Set API Key]",
     "From": "[FixedFrom value of Mail.json]",
     "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"
         }
     ]
}

For information about the FixedFrom value, please refer to Mail.json.

Response

The JSON data in the following format will be returned and the email will be sent.

Response Sample
1
2
3
4
5
{
    "Id": <record ID>,
    "StatusCode": 200,
    "Message": "Email sent."
}

Confirmation Column in Case of Error

Supported Versions

Supported Versions Body
1.2.4.0 and later Added Attachments

  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
    
     ↩