Simple email

This method allows you to send a single email message to one destination address.



Property name Type Description
from string Email address with optional sender name. Example: "Jane Doe <>"
to string Email address of the recipient
subject string Message subject
text string Body of message
bulkId string The ID uniquely identifies the sent Email request. This filter will enable you to query delivery reports for all the messages using just one request. You will receive a bulkId in the response after sending an Email request. If you don't set your own bulkId, unique ID will be generated by our system and returned in the API response.

Request Example

					curl -s --user user:password \ \
-F from='Jane Doe <>' \
-F to='' \
-F subject='Mail subject text' \
-F text='Mail body text' \
-F bulkId='cusotmBulkId'
					POST /email/1/send HTTP/1.1
Authorization: Basic bWt1dGljMjpNdTtpMjAxMiws
Accept: application/json
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

Content-Disposition: form-data; name="from"

Jane Doe <>
Content-Disposition: form-data; name="to"
Content-Disposition: form-data; name="subject"

Mail subject text
Content-Disposition: form-data; name="text"

Mail body text
Content-Disposition: form-data; name="bulkId"

define('EOL',"\r\n");// PHP_EOL cannot be used for emails we need the CRFL '\r\n'

 * Method to convert an associative array of parameters into the HTML body string
function getBody($fields) {
    $content = '';
    foreach ($fields as $FORM_FIELD => $value) {
        $content .= '--' . MULTIPART_BOUNDARY . EOL;
        $content .= 'Content-Disposition: form-data; name="' . $FORM_FIELD . '"' . EOL;
        $content .= EOL . $value . EOL;
    return $content . '--' . MULTIPART_BOUNDARY . '--'; // Email body should end with "--"

 * Method to get the headers for a basic authentication with username and passowrd
function getHeader($username, $password){
    // basic Authentication
    $auth = base64_encode("$username:$password");

    // Define the header
    return array("Authorization:Basic $auth", 'Content-Type: multipart/form-data ; boundary=' . MULTIPART_BOUNDARY );

// URL to the API that sends the email.
$url = '';

// Associate Array of the post parameters to be sent to the API
$postData = array(
    'from' => '',
    'to' => '',
    'subject' => 'Mail subject text',
    'text' => 'Mail body text',

// Create the stream context.
$context = stream_context_create(array(
    'http' => array(
          'method' => 'POST',
          'header' => getHeader('username', 'password'),
          'content' =>  getBody($postData),

// Read the response using the Stream Context.
$response = file_get_contents($url, false, $context);
					/*----Sending single email----*/

var formData = new FormData();
formData.append('from', 'Example <>');
formData.append('to', '');
formData.append('subject', 'Test subject');
formData.append('text', 'Sample Email Body');

var xhr = new XMLHttpRequest();
xhr.withCredentials = false;

xhr.addEventListener('readystatechange', function () {
    if (this.readyState === this.DONE) {
});'POST', '', false);
xhr.setRequestHeader('authorization', 'Basic bWt1dGljMjpNdTtpMjAxMiws');
xhr.setRequestHeader('accept', 'application/json');

					ContentType PLAIN_UTF8 = ContentType.create("text/plain", StandardCharsets.UTF_8);

        HttpClient httpClient =  HttpClients.custom()
                .setConnectionManager(new PoolingHttpClientConnectionManager())

        HttpPost httpPost = new HttpPost("");
        httpPost.setHeader("authorization", "Basic YXJhamhhbnNhOmF4ZGNmcnQyMz");

        MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create();
        entityBuilder.addPart("from", new StringBody("Jane Doe <>", PLAIN_UTF8));
        entityBuilder.addPart("to", new StringBody("", PLAIN_UTF8));
        entityBuilder.addPart("subject", new StringBody("Mail subject text", PLAIN_UTF8));
        entityBuilder.addPart("text", new StringBody("Mail body text", PLAIN_UTF8));

        HttpResponse httpResponse = httpClient.execute(httpPost);
					HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("");
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", "dJKDndiasdf797899ar4rkn2FtS0BiQGRkIQ");
            var request = new MultipartFormDataContent();            
            request.Add(new StringContent("Jane Doe <>"), "from");
            request.Add(new StringContent(""), "to");
            request.Add(new StringContent("Mail subject text"), "subject");
            request.Add(new StringContent("Rich HTML message body."), "text");
	    var response = client.PostAsync("email/1/send", request).Result;
            if (response.IsSuccessStatusCode) {
                var responseContent = response.Content;
                string responseString = responseContent.ReadAsStringAsync().Result;


  "messages": [
      "to": "",
      "messageCount": 1,
      "messageId": "c268350e-c85e-41d1-b5a0-a60771b134bd",
      "status": {
        "groupId": 1,
        "groupName": "PENDING",
        "id": 7,
        "name": "PENDING_ENROUTE",
        "description": "Message sent to next instance"

Response format

If successful, the response header HTTP status code will be 200 OK and the message will be sent.

If you try to send a message without authorization, you will receive a 401 Unauthorized error .


Parameter Type Description
bulkId String Either a user provided custom bulk id or an auto generated one in case bulkId was absent in the request.
messages MessageInfo Array of sent message objects, one object per every message.


Parameter Type Description
to String The message destination address.
status Status Indicates whether the message is successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status.
messageCount int The number of sent message segments.
messageId String The ID that uniquely identifies the message sent.


Parameter Type Description
groupId int Status group ID.
groupName String Status group name.
id int Status ID.
name String Status name.
description String Human-readable description of the status.
action String Action that should be taken to eliminate the error.