You can send a test email from the mail server by specifying information such as the host name and delivery address.
Execution permission
Admin
Request line
POST baseURL/v1/services/EmailServerSettings/actions/sendTestMail/invoke
Request body
The structure of the request body and the object attributes are as follows:Action
{ "name":"...", "href":"...", "method":"...", "type":"...", "parameters":["...", ...] }
Action (Type: Action)
Attribute |
Type |
Description |
---|---|---|
name |
string |
Name of the action. |
href |
string |
URL for the action. |
method |
string |
Name of the method. |
type |
string |
Data format for the object. |
parameters |
anyType[] |
A list of TestMail objects necessary to execute an operation. For details, see the table below. |
TestMail
{ "destinationAddresses":["...", ...], "emailSetting":{ "instanceID":"...", "hostname":"...", "authenticationEnabled":"...", "userId":"...", "updatePassword":"...", "password":"...", "senderAddress":"...", "secureConnection":"...", "portNumber":"..." } }
TestMail (Type: TestMail)
Attribute |
Type |
Description |
---|---|---|
destinationAddresses |
string[] |
Email address specified as the destination of the test email |
emailSetting |
EmailSetting |
Email server settings used to send a test email |
emailSetting (Type: EmailSetting)
Attribute |
Type |
Description |
---|---|---|
instanceID |
string |
ID of the mail server settings |
hostname |
string |
IP address or host name of the SMTP server |
authenticationEnabled |
boolean |
Whether or not to enable authentication of the user who sends emails. If enabled, "true" is set. If disabled, "false" is set. |
userId |
string |
User ID used for authentication of the user who sends emails. This item is set only if authenticationEnabled is "true". |
updatePassword |
boolean |
Whether or not to change the password that is used to authenticate the email sender. Specify this item if the password needs to be changed when the mail server settings are changed. To change the password, specify "true". To not change the password, specify "false". |
password |
string |
Password used for authentication of the user who sends emails. Specify a string encoded in Base64. |
senderAddress |
string |
Sender address |
secureConnection |
enum |
Setting of security used when emails are sent (For details about the valid values, see the table SecureConnectionType in List of enumerators.)
|
portNumber |
int |
Port number used for connection to the SMTP server |
Response body
The structure of the response body and the object attributes is as follows:Job
{ "instanceID":"...", "created":"...", "updated":"...", "completed":"...", "state":"...", "affectedResource":["...", ...], "result":["...", ...] }
Job (Type: Job)
Attribute |
Type |
Description |
---|---|---|
instanceID |
string |
ID of the Instance. |
created |
string |
Date the object is generated in "yyyy-mm-ddThh:mm:ss.mmmTZD" format (e.g., 2017-08-25T20:07:39.472+09:00). |
updated |
string |
Time the object is updated in "yyyy-mm-ddThh:mm:ss.mmmTZD" format (e.g., 2017-08-25T20:07:39.472+09:00). |
completed |
string |
Time the processing completed in "yyyy-mm-ddThh:mm:ss.mmmTZD" format (e.g., 2017-08-25T20:07:39.472+09:00). |
state |
string |
One of the following values is set: "failed": The operation failed. "success": The operation completed successfully. |
affectedResource |
string[] |
A blank space is set. |
result |
anyType[] |
A list of objects. No value is set. |
Status codes
Status code |
Reason phrase |
Description |
---|---|---|
200 |
OK |
Success. |
400 |
Bad Request |
The format of the request body is invalid. |
401 |
Unauthorized |
No login privilege. |
403 |
Forbidden |
No execute privilege. |
412 |
Precondition Failed |
The server is not available. |
500 |
Internal Server Error |
Server processing error. |
Example code
[Request Header] POST /Analytics/v1/services/EmailServerSettings/actions/sendTestMail/invoke Authorization: Basic c3lzdGVtOm1hbmFnZXI= Host: localhost:22015 Accept: application/json Content-Type: application/json [Request Body] { "name": "sendTestMail", "href": "http://localhost:22015/Analytics/v1/services/EmailServerSettings/actions/sendTestMail/invoke", "method": "POST", "type": "application/json", "parameters": [ { "emailSetting": { "instanceID": "mailServerSetting#0", "hostname": "172.17.17.116", "authenticationEnabled": true, "userId": "user1", "updatePassword": true, "password": "a2FzaGltYTE=", "senderAddress": "user@example.com", "secureConnection": "Plain", "portNumber": 25 }, "destinationAddresses": [ "user2@example.com", "user3@example.com" ] } ] } [Response Header] HTTP/1.1 200 OK Date: Mon, 22 Aug 2016 04:46:45 GMT Server: Cosminexus HTTP Server Cache-Control: no-cache WWW-Authenticate: HSSO f0f3ee9e20f6ce82bf67a24e862b7b86e7ef8bb0_Y2UOI2pkMXQ=_V0810 X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Transfer-Encoding: chunked Content-Type: application/json [Response Body] { "instanceID": "33f2e181-4f13-408a-91c1-d13c858519d9", "created": "2016-08-22T13:46:46.097+09:00", "updated": "2016-08-22T13:46:46.097+09:00", "completed": "2016-08-22T13:46:46.097+09:00", "state": "success", "affectedResource": [ ], "result": [ ] }