Send Email

This function is used to send email.

The sender is specified either by “Org” (we will use the SMTP configuration on the organization level) either by “CurrentUser” (we will use the SMTP configuration on the user level).

This function takes as argument an object that has the following fields:

  • emailFrom: set “Org” / “CurrentUser
  • emailTo: recipient email (you can put several emails separated by “;”).
  • emailCC: carbon copies recipient (you can put several emails separated by “;”).
  • emailBCC: blind carbon copies recipient (you can put several emails separated by “;”).
  • emailReplyTo: email address to reply to for the mail message (you can put several emails separated by “;”).
  • emailSubject: message subject.
  • emailBody: message body.
  • emailIsBodyHtml: set true/false to indicate whether the mail message body is in HTML or not.
    • Function: SendEmail(<Email Object>)
    • Usage:

var strBody = "Email message body";
var Email = { emailFrom: "Org", emailTo: "address1@example.com", emailCC: "address2@example.com;address3@example.com", emailBCC: " ", emailReplyTo: " ", emailSubject: "Email Subject", emailBody: strBody, emailIsBodyHtml: true };

var ObjResult = SendEmail(Email);
var status  = ObjResult.msgSuccess;
var message = ObjResult.msgInfo;

    • Output:
      • Success:
        A success flag is returned with value = true.
        The following message will be displayed “Email sent.”
      • Failure:
        A success flag is returned with value = false.
        An error message will be displayed.
Was this article helpful to you? Yes No

How can we help?