Email API

fastCode’s Email API allows users to send text emails with attachments and HTML emails with attachments and inline images.

API Reference:

Sending HTML emails with inline images and attachments

The first step in sending an HTML email with inline images and optional attachments is to design the HTML email content using an editor of your choice. In the HTML content, we need to ensure that the name of each image is represented using the cid: tag embedded within the "emailBody" section of JSON in the example below.

    "to": "[email protected],[email protected]",

    "cc": "",

    "bcc": "",

    "subject": "Email API Testing",

    "emailBody": "\"<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <title>Title<\/title>\r\n<\/head>\r\n<body>\r\n<img src=\"cid:img_1.jpg\" alt=\"Flowers in USA\">\r\n<p>This is going to the second image for our testing.\r\nEnjoy the flowers!\r\n<\/p>\r\n<br>\r\n<br>\r\n<br>\r\n<p>This is going to be our 3rd image for testing\r\nEnjoy the flowers!\r\n<\/p>\r\n<img src=\"cid:img_2.jpg\" alt=\"Flowers in Chania\">\r\n<p><\/p>\r\n<br>\r\n<br>\r\n<br>\r\n\r\n<img src=\"cid:img_3.jpg\" alt=\"Flowers in Chania\">\r\n<\/body>\r\n<\/html>\"",
    "replyTo": "[email protected]",



    "attachments": [11,16]

Secondly, we need to create File entities corresponding to each attachment/inline image, and send their Id’s in the ReST API call as shown in the example above.

The only mandatory field to send an email is the “To” email address.

Sending text emails with attachments

The process for sending an email with optional attachments is similar to the process for sending an HTML email. To send a text email, set "isHtml":false. Text emails don’t support inline images and the API call will fail if the text email is sent with inline images.