Send mail - Deluge

Send mail Deluge task


The send mail task can be used to send emails from your Zoho Creator Application. For example, you can invoke the "send mail" function from Form Actions -> on add -> on success script to send mail when a new record is successfully added to the database.

You can also directly specify the address in the To: field within quotes, for example "", if the to address remains the same for all the records. To send mail to the email ids specified in each record, use the input.<field_name_of_type_email>, which will replace the value of the email id in each record. The subject and message fields can be customized to suit the user requirements. Again, the input.<field_name> can be used to substitute the value of the record.

Note: The From address should only be zoho.adminuseridzoho.loginuserid or a verified email address. Otherwise, the sendmail task will fail. This restriction is imposed to control spam messages.


From : <string expression>
To : <string expression>
Subject : <string expression>
Message : <string expression>


  • To- the mail recipient
  • From- the sender
  • Subject - the text you want to display in the message subject
  • Message- the text you want to display in the message body
  • <string expression> - deluge expression evaluating to valid email address in case of From and To and any valid string in case of subject and message. subject and message are optional parameters. To know in detail about the expressions in Deluge, refer to Expressions.


  • If your Form is accessed by users without logging in to Zoho Creator, the variable zoho.loginuserid will be set as “Public”. As “Public” is not an email address, the send mail action fails to execute. 

 Using Script Builder

You can configure to send e-mail message with form data either from the Form GUI or by adding Deluge Script with the Send mail task.

  1. To configure email notifications from the Form GUI, refer the topic, Configure email notifications from GUI. The email notifications configured from the Form GUI will be displayed as a script in the Form Actions -> on add -> on success block of the Script tab.
  2. To configure email notifications with form data by adding Deluge Script, use the input.formdata variable in On Add -> On Success or On Edit -> On Success script.

Steps to add the Send mail script using Script Builder:

  • Select the Script tab.
  • Select the required Form from the drop down in the page header.
  • Select the Form action to invoke the script. For example, if you want to send mail when a record is submitted, select the form action on Add -> On Success.
  • Next, select the Deluge task that needs to be executed. To send mail, drag-n-drop the send mail task to the editor area.
  • The screen shot below shows the deluge task added to the editor area.

On clicking the Edit button in the script, the Send Mail screen is displayed.

  • Specify the From, To, Subject and Message in the Send Mail screen.
  • To send mail with formdata, specify the message as shown in the below format selecting the Rich text tab.
  • Click Done to update the configurations to the script builder.
  • Click Save Script to save the script.

Now, when a record is submitted, the configured email is sent to the specified To address with the Form data. A sample format of the email is shown below.

 Include record summary in send mail

You can include the record summary template in your send mail task configured in the Form Actions -> On Success block . If Include Template check-box is selected, the record templates created for the form will be displayed as a list below this option. You can select the required template and choose to send it as an inline content or as PDF attactments. If you have not created any custom record templates, use the Default Template that displays the form data in a simple table format.


Example 1

The CEO of a company wants to address all the new employees who have joined after certain date say, '10-jun-2007' . We have to mail all these new employees. Lets see how we can achive this.

  1. Form 'Employee' has the following fields: Name, Qualification, EmailID, TeamName, JoinDate
  2. Write on add -> On success script, as given below:

for each x in Employee [JoinDate >'10-Jul-2007']
To : x.EmailID
From : zoho.adminuserid
Subject : "Meeting at 6:pm tomorrow"
Message : "As our CEO wants to address the new employees, you are requested to attend the meeting.

Code Explanation

  • for each x in Employee [JoinDate > '10-Jul-2007'] - Fetches the records from the Employee form with the given criteria and iterates over each record, to send mail to the EmailID of each record. Here 'x' is the instance variable that will represent a single record in each iteration.
  • sendmail - The deluge function to send mail
  • x.EmailID - Refers to the emailid of each record

Example 2

To send a link/url in your e-mail message, the actual link must be specified within the <a href> html tag and within single quotes, as shown in the sample below. The code is added to On Add -> On Success section.

To : zoho.loginuserid
From : zoho.adminuserid
Subject : "sending links in e-mail messages"
Message : "Please refer the following links :
"<a href=' '>PDF1</a>" +"<a href=' '>PDF2</a>"

Example 3

To send only specific field values in your e-mail, use the input. variable in the send mail task. For example, you have 3 fields (Name, Age, Email), and in the email message you want to send only the Name and E-mail field values. The format for the same will be,

To : zoho.loginuserid
From : zoho.adminuserid
Subject : "Order Confirmation"
Message : "Name : "+input.Name+"Email : "+input.Email

Example 4

We have an uninstall form with options "Dont Need it", "Not satisfied with the service" and "Temporary Uninstall" added as decision fields. Before uninstalling the app, a customer needs to fill in this form with his selected options.

Screenshot displaying the uninstall form with selected options

Upon submitting the form, a mail is generated to the app owner with the options he has chosen.

Screenshot displaying the mail content

This can be achieved by adding the following code in the On Add -> On Success section of the form:

//declare and iterate a variable to store the selected options
tempstr = "";
if(input.Dont_need_it == true)
tempstr = tempstr + "<br />Dont Need it"; 
if(input.Not_satisfied_with_the_service == true)
tempstr = tempstr + "<br />Not satisfied with the service"; 
if(input.Temporary_Uninstall == true)
tempstr = tempstr + "<br />Temporary Uninstall";

//add send mail task to send a mail with selected options
To : zoho.adminuserid
From : zoho.loginuserid
Subject : "Test"
Message : "<p>My reasons for uninstalling the app are:</p>"+ tempstr

 Related Topics

Send mail to selected records in a view using Custom Actions

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: