Code preference:
Curl
Ruby
Php
Python
Node.js
C#
Java

Sending transactional email

Developers can send transactional emails using this API. Following is the operation supported by this API.

Input Parameter Description
to Email address of the recipient(s). It should be sent as an associative array. Example: array(“to@example.net”=>”to whom”). You can use commas to separate multiple recipients [Mandatory].
subject Message subject [Optional].
from Email address for From header. It should be sent as an array. Example: array(“from@email.com”,”from email”) [Mandatory].
html Body of the message (HTML version) [Mandatory].
To send inline images, use < img src="{YourFileName.Extension}" alt="image" border="0" >, the src attribute value inside {} (curly braces) should be same as the filename used in inline_image parameter
text Body of the message. (text version) [Optional].
cc Same as to but for Cc. Example: array(“cc@example.net”=>”cc whom”) [Optional].
bcc Same as to but for Bcc. Example: array(“bcc@example.net”=>”bcc whom”) [Optional].
replyto Same as from but for Reply To. Example: array(“from@email.com”,”from email”) [Optional].
attachment Provide the absolute URL of the attachment/s. Url not allowed from local machine. File must be hosted somewhere. Example: array(“http://example.net/upload-file”).
Possible extension values = gif, png, bmp, cgm, jpg, jpeg, tif, tiff, rtf, txt, css, shtml, html, htm, csv, zip, pdf, xml, doc, docx, ics, xls, xlsx, ppt, tar, and ez.
OR
To send attachment/s generated on the fly you have to pass your attachment/s filename & its base64 encoded chunk data as an associative array. Example: array(“YourFileName.Extension”=>”Base64EncodedChunkData”). You can use commas to separate multiple attachments [Optional].
headers The headers will be sent along with the mail headers in original email. Example: array(“Content-Type”=>”text/html; charset=iso-8859-1″). You can use commas to separate multiple headers [Optional].
inline_image Pass your inline image/s filename & its base64 encoded chunk data as an associative array. Example: array(“YourFileName.Extension”=>”Base64EncodedChunkData”). You can use commas to separate multiple inline images [Optional].

Example :

Sample Output :

Sendinblue reserves below mentioned headers, to provide different features on the platform:

Header Description
“X-Mailin-custom”=> “My custom value” To send some custom text.
“X-Mailin-IP” => “102.102.1.2” Send your dedicated IP which is associated with your Sendinblue SMTP account. We will relay email via this IP.
“X-Mailin-Tag” => “My tag” Define tag, to search as per tag.

Note:
“X-Mailin-IP” will not be sent along with the mail headers in original email.
“X-param1″, “X-param2″, “X-Mailin-custom” and “X-Mailin-Tag” will be sent along with the mail headers in original email.
“X-Mailin-custom” and “X-Mailin-Tag” will also be sent along with the JSON response of webhooks, when some event occurs. Also, the “X-Mailin-Tag” will be received as only “tag” in the JSON response.

How to send attachment/s generated on the fly

Please note that your email content and attached files size should not be greater than 10 MB.

Example :