Skip to main content

SendEmailAsync

1. Facts

info

Send an email without attachments, without template.

Method URL

<base url>/send

Preferred HTTP method: POST

Authorization: Basic <Your secret string>
ApplicationName: <Your application name>

Body (JSON)

{
"senderAddress": "AMES ENGLISH<mailer@ames.edu.vn>",
"receiverAddress": "tungnt@ames.edu.vn, tungnt@softech.vn",
"ccAddress": "ngothanhtung.it@gmail.com",
"bccAddress": "tung.ngo@outlook.com",
"subject": "Send SES (SendEmailAsync)",
"textBody": "This email was sent through Amazon SES",
"htmlBody": "<h1>This email was sent through Amazon SES</h1>"
}

Response

{
"ok": true,
"eventName": "AWS-SES:SendEmailAsync",
"result": {
"messageId": "010e0179dd19b2b8-70fd994f-9a04-4337-9f8b-356530d96c33-000000",
"responseMetadata": {
"requestId": "8288b053-222e-43c6-8be8-b4bb7c2e0b17",
"metadata": {}
},
"contentLength": 326,
"httpStatusCode": 200
},
"apiVersion": {
"groupVersion": null,
"majorVersion": 1,
"minorVersion": null,
"status": null
},
"applicationName": "EBM"
}

2. Example (C#)

var client = new RestClient("https://softech.cloud/api/v1/aws/ses/send");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Basic <Your secret string>");
request.AddHeader("ApplicationName", "EBM");

var body = new {
senderAddress = "AMES ENGLISH<mailer@ames.edu.vn>",
receiverAddress = "tungnt@ames.edu.vn, tungnt@softech.vn",
subject = "Send SES from POSTMAIN within API",
textBody= "This email was sent through Amazon SES",
htmlBody = "<h1>This email was sent through Amazon SES</h1>"
};

request.AddJsonBody(body);
IRestResponse response = client.Execute(request);