Skip to content

Send Basic Emails API

Backendless provides API for basic email delivery. The API lets you specify:

  • plain text and/or HTML-based content for your email messages;
  • a list of email address for the recipient;
  • a list of attachments;


Before the API can be used, the Backendless backend must be configured with your own SMTP server information. This is an important requirement as the API will not work when the Manage > App Settings > Email Settings section in Backendless Console contains default values. For instructions on how to configure your own SMTP server in Backendless, see the Email Settings section.

Sending Email API

Delivers an email message to the recipient(s) specified in the API call.

Backendless.Messaging.sendEmail( subject, bodyParts, recipients, attachments );


Argument                Description
subject email message subject.
bodyParts an instance of Bodyparts,  which contains either plain text and/or HTML version of the message body.
recipients an array of email addressed to deliver the email message to.
attachments an array of file paths for the file entries from the Backendless File Service. Referenced files will be attached to the email message. The path is calculated from the root of the file system (as it is seen in File Service browser in Backendless console) without the leading slash. For example, if file agreement.txt is located at /documents/legal/, then the path in the API call must be "documents/legal/agreement.txt".


// prepare message bodies (plain and html) and attachment
var bodyParts = new Backendless.Bodyparts();
bodyParts.textmessage = "Check out this awesome code generation result";
bodyParts.htmlmessage = "Check out this <b>awesome</b> code generation result";
var attachments = ["" ];

Backendless.Messaging.sendEmail( "Email from Backendless", 
                                 [ "" ], 
                                 attachments )
 .then( function( response ) {
   console.log( "message has been sent" );
 .catch( function( error ) {
   console.log( "error " + error.message );