Choose where you’d like to start

Send mail

Overview

To improve email deliverability, we will be following Gmail's updated sender email policy starting from February 1, 2024. This means that Gmail addresses cannot be used as a sender address in the send mail tasks.  Learn More

The send mail deluge task when executed sends an email to the specified recipients.

For example, in Zoho Creator:

  • You can use this task to send a confirmation email to users when they successfully submit a form.
  • You can attach reports to the email, select what records you want to send based on criteria, attach file upload field values, attach record templates, and you can choose the format in which the attachment will be sent.

Syntax

 sendmail
                 [
                 from: <from_address>
                 to: <to_address>
                 cc: <cc>
                 bcc: <bcc>
                 reply to: <reply_to_address>
                 subject: <subject>
                 message: <message>
                 content type: <content_type>
                 attachments: <attachment>
                 ]
                
ParameterData typeDescription
<from_address>
TEXT

The value you provide here will be displayed as the sender's email address.

Allowed Values:

  • You can hardcode the sender's email address.
  • You can specify the system variable zoho.adminuserid.
  • You can specify the system variable zoho.loginuserid as long as the user is not a customer portal user. If the user is a portal user, the email address has to be verified before it can be used as the FROM address.
  • In Zoho Creator, the address can be specified in the format "John <john@zylker.com>" to display the sender name in the recipient's inbox.
  • In Zoho Creator, you can specify the value entered in email address field type in your form in the format: input.<email_field_link_name>.
Note: Click here to learn about which the restrictions imposed on this parameter in view of spam control.
<to_address>TEXT/ LIST

The email address to which the email will be sent.

Allowed Values:

  • You can hardcode the recipient's email address.
  • You can specify multiple email addresses separated by commas, or held in a LIST.
  • You can specify system variables zoho.adminuserid and zoho.loginuserid.
  • In Zoho Creator, you can specify the value entered in email address field type in your form in the format: input.<email_field_link_name>.

<cc_address>

(optional)

TEXT/ LIST

Email address of the recipients to whom the email should be copied. Recipients in this list will be able to see all others in this list.

Allowed Values:

  • You can hardcode the CC email address.
  • You can specify multiple email addresses separated by commas, or held in a LIST.
  • You can specify system variables zoho.adminuserid and zoho.loginuserid.
  • In Zoho Creator, you can specify the value entered in email address field type in your form in the format: input.<email_field_link_name>.

<bcc_address>

(optional)

TEXT/ LIST

Email address of the recipients to whom the email should be copied. Recipients in this list will not be able to see others in this list.

Allowed Values:

  • You can hardcode the BCC email address.
  • You can specify multiple email addresses separated by commas, or held in a LIST.
  • You can specify system variables zoho.adminuserid and zoho.loginuserid
  • In Zoho Creator, you can specify the value entered in email address field type in your form in the format: input.<email_field_link_name>.

<reply_to_address>

(optional)

TEXT/ LIST/ comma-separated TEXT

The email address specified here will be populated in the "To" address when the email recipient clicks on "Reply" for the email notification which is editable.

The following are the examples of how multiple reply to email addresses can be provided.

  • List:
replyToAddresses = List();
replyToAddresses.add("shawn@zylker.com");
replyToAddresses.add("hailee@zylker.com");
replyToAddresses.add("brent@zylker.com");
  • Text:
replyToAddresses = "shawn@zylker.com, hailee@zylker.com, brent@zylker.com";
  • Comma-separated Text values
reply to = "shawn@zylker.com", "hailee@zylker.com", "brent@zylker.com"
Note: You can provide a maximum of 20 reply to email addresses.
<subject>All data typesSubject of the email.
<message>All data typesContent of the email. This can be provided as HTML or plain text.

<content_type>

(optional)

TEXT

It could be one of the following:

  • HTML - Executes the HTML tags present in the message content
  • Plain Text - Treats the message content as text

Default value: HTML

Note: By default, if the <message> content contains HTML tags, they will be rendered. To send HTML tags without rendering, mention <content_type> as Plain rexr.

<attachments>

​(optional)

FILE

Files that needs to be attached with the mail.

Note: 

  • The maximum size of attachments is 15 MB. If the attachments exceed this limit, the emails will be delivered without them.
  • In Zoho Creator, if attachments exceed this limit, a note indicating that an attachment has been dropped will be sent to the recipient along with the email content.
  • The value of this parameter needs to be in the following format to attach files fetched using invokeUrl task:
    • To attach a single file:
      file: <file_attachment>
       
    • The formats to attach multiple files: (or)
      • List of files
        file: <file_attachment_list>
        where, <file_attachment_list> is the LIST containing the attachments.
      • As comma-separated values
        file: <file_attachment_1>, file: <file_attachment_2>, file: <file_attachment_3>,.. 
         
  • To attach Zoho Creator entities, the value of this parameter needs to be in the format specified in the below table:

To attach Zoho Creator entities

Zoho Creator EntityFormatDescription
Reports

For Pivot reports:

report: <Report_link_name> as PDF
 

For all other report types:

view: <Report_link_name> [<criteria>] as <attachment_format>

Use this parameter to attach a report, containing records which meet a specified criteria, in a specified format.

  • <Report_link_name> refers to the link name of the report whose records will be sent as an attachment.
  • <criteria> refers to the criteria based on which records will be sent. The criteria is mandatory.
  • <attachment_format> refers to the format in which the attachment will be sent. Applicable formats are:
    • PDF
    • XLS
    • TSV
    • CSV

You can attach multiple reports separated by a comma as shown below:

view: <Report_link_name1> [<criteria>] as <attachment_format>, view: <Report_link_name2> [<criteria>] as <attachment_format>, view: <Report_link_name3> [<criteria>] as <attachment_format> ....

Note: This entity is not applicable for published forms.
Files uploaded in file fieldsfile: input.<file_upload_field>

Use this parameter to attach the values specified in the file upload field types while submitting the form

  • <file_upload_field> refers to the link name of the file upload field type in the form.

You can attach multiple file upload field values separated by a comma as shown below:

file: input.<file_upload_field1>, file: input.<file_upload_field2>, file: input.<file_upload_field3> ...

Files fetched using the fetch record taskfile: <collection_variable>.<file_upload_field>

Use this parameter to attach file upload field type values held in a collection variable.

  • <file_upload_field> refers to the link name of the file upload field type in the first record in the collection variable. 

You can attach multiple file upload field values in different collection variables separated by a comma as shown below:

file: <collection_variable1>.<file_upload_field>, file: <collection_variable2>.<file_upload_field>, file: <collection_variable3>.<file_upload_field> ...

Record template

Syntax in form workflow:

template: <record_template> as <attachment_format>

Syntax in custom function:

template: <record_template>: <form_link_name> <record_id_variable> as <attachment_format>

Use this parameter to attach record templates in a specified format.

  • <record_template> refers to the link name of the Record Template.
  • <attachment_format> refers to the format in which the attachment will be sent. Applicable values(to be specified without quotes) :
    • PDF - sends record templates as PDF attachment
    • inline - sends record templates as inline message content

Only templates based on the form specified in the workflow can be sent as an attachment.

You can attach multiple templates separated by a comma as shown below:

template: <record_template1> as <attachment_format>, template: <record_template2> as <attachment_format>, template: <record_template3> as <attachment_format> ....​​

Use the following syntax to attach multiple templates to a sendMail task written in a custom function

template: <record_template1>: <form_link_name1> <record_id_variable1> as <attachment_format>, template: <record_template2>: <form_link_name2><record_id_variable2> as <attachment_format>, template: <record_template3>: <form_link_name3><record_id_variable3> as <attachment_format> ....​​

Note: The <record_id_variable> can be a variable that holds the ID of the record or a fetch records task that extracts the ID of a specific record. You cannot directly supply a NUMBER value representing the required record ID.

In Zoho Creator, this task can be used in the following events

When a record is Created
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Created or Edited
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Edited
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Deleted
On ValidateYes
On SuccessYes
Other workflow events
On a scheduled dateYes
During approval processYes
During payment processYes
In a Custom FunctionYes
In an Action item in reportYes

Send emails from a verified address

Anti-spam measures

  • In services other than Zoho Cliq, the From: address should only be specified as zoho.adminuserid, or zoho.loginuserid*, or a verified email address. Otherwise, the sendmail task will fail.

    FromToResult
    zoho.adminuserid, zoho.loginuserid (*only when the logged in user is not a customer portal user), or verified email address
    (or)
    variable that contains any of these
    Any email addressMail will be sent
    email address other than zoho.adminuserid, zoho.loginuserid, or verified email addressAny email addressError while saving
    variable that contains email address other than zoho.adminuserid, zoho.loginuserid, or verified email addressAny email addressError during run time
  • In Zoho Cliq, the From: address should only be specified as zoho.loginuserid, or a verified email address. Otherwise, the sendmail task will fail.

    FromToResult
    zoho.loginuserid or verified email address
    (or)
    variable that contains any of these
    Any email addressMail will be sent
    email address other than zoho.loginuserid or verified email addressAny email addressError while saving
    variable that contains email address other than zoho.adminuserid, zoho.loginuserid, or verified email addressAny email addressError during run time

Examples

1) The following script is a sample snippet of the send mail task.

sendmail  
 [  
    from: zoho.adminuserid  
    to: "shawn@zylker.com"  
    cc: "salesmanager@zoho.com"  
    reply to: "support@zohocreator.com"  
    subject: "Welcome to Zoho Creator"  
    message: "<p>Your registration with Basic Plan is successful. You have selected the following Add-on:</p><ul><li>Customer Portal - 500 users</li></ul>"  
 ]

 

Note: You can use HTML tags to format your email content. For example, use <br /> tag to add a line break, <p> </p> tags to include a paragraph, and so on.

2) The following script is a sample snippet of the send mail task being used in Zoho Creator. It sends an email from a verified email address. The mail is displayed along with the specified name in the recipient's inbox.

sendmail  
 [  
    from: "Shawn <shawn@zylker.com>"  
    to: "john@zylker.com"  
    cc: "salesmanager@zoho.com"  
    reply to: "support@zohocreator.com"  
    subject: "Team meeting"  
    message: "Let's meet at 5"  
 ]


3) The following script sends an email with an attachment fetched using the invokeURL task. The email is sent to the email address in the 'candidate_email' field.

fileResp = invokeUrl  
 [  
    url: "https://www.zohowebstatic.com/sites/zweb/images/ogimage/zoho-logo.png"  
    type: GET  
 ]; 
sendmail  
 [  
    from: zoho.adminuserid  
    to: candidate_email  
    subject: "Welcome aboard"  
    message: "We welcome you aboard. Here's wishing you a great career with us."  
    Attachments :file: fileResp  
 ]


4) The following script sends an email with a report as an attachment from Zoho Creator. The email is sent to the email address in the 'team_email' field. Only the records which meet the given criteria are included in the report. The report link name is "Leads_Report", and only the records which contain the "Status" field value as "Converted" are included in the sent report.

sendmail  
 [  
    fromzoho.adminuserid  
    toinput.team_email  
    subject: "Today's Deals"  
    message: "Please find the PDF attachment for today's deals"  
    Attachments :view: Leads_Report [Status=="Converted"] as PDF  
 ]


5) The following script sends an email with the 'File Upload' field value as an attachment from Zoho Creator. The email is sent to the email address in the 'hr_email' field. The 'File Upload' field link name is 'resume'.

sendmail  
 [  
    fromzoho.adminuserid  
    to: input.hr_email  
    subject: "New application received"  
    message: "Please find the resume attached."
    Attachments :file: resume  
 ]


6) The following scripts send an email with a record template as an attachment from Zoho Creator. The email is sent to the email address in the 'customer_email' field. The template link name is 'Medical_Invoice' and the form link name is 'invoice_details'.

Script if written in form workflow
 

sendmail  
 [  
    fromzoho.adminuserid  
    toinput.customer_email  
    subject: "Thank you for the payment"  
    message: "Please find your invoice in the attachment"
    Attachments :template: Medical_Invoice as PDF  
 ]


Script if written in custom function 

 record_id = invoice_details[ID!= 0].ID;
 sendmail  
 [  
    fromzoho.adminuserid  
    toinput.customer_email  
    subject: "Thank you for the payment"  
    message: "Please find your invoice in the attachment"
    Attachments :template: Medical_Invoice: invoice_details record_id as PDF  
 ]

 

7) The following script sends an email with a report from Zoho Creator and an image fetched using the invoke URL task from Workdrive as attachments. The email is sent to the email address in the 'Customer Email' field. Only the records which meet the given criteria are included in the report. The report link name is "Medical_Equipment_Report", and only the records which contain the "Availability" field value as "In Stock" are included in the sent report.

fileResp = invokeurl
                [
                    url :"https://download.zoho.com/v1/workdrive/download/9sv1b827f33bdcab545b583168f9642eabd29"
                    type :GET
                    connection :"Workdrive"
                ];
                sendmail
                [
                    from :zoho.adminuserid
                    to : "Customer_Email"
                    subject :"Inventory of Medical Equipments"
                    message :"Dear customer, we have attached the report of our medical equipment inventory and a     pamphlet mentioned special offers on bulk orders."
                    Attachments : file: fileResp, view:Medical_Equipment_Report[Availability == "In Stock"] as PDF
                ]
                

 

Note:

  • Create an OAuth connection named Workdrive and make sure to select WorkDrive.files.READ and ZohoFiles.files.READ scopes.
  • "9sv1b827f33bdcab545b583168f9642eabd29" mentioned in the above script is the resource ID of the image that has been uploaded to the Workdrive. It will not be the same for everyone. Copy and paste the resource ID of your image in its place and execute the script.
 

Get Started Now

Execute