Send mail
Overview
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> ]
Parameter | Data type | Description | ||||||||
<from_address> | TEXT | The value you provide here will be displayed as the sender's email address. Allowed Values:
Note: Click here to learn about 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:
| ||||||||
<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:
| ||||||||
<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:
| ||||||||
<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.
replyToAddresses = List(); replyToAddresses.add("shawn@zylker.com"); replyToAddresses.add("hailee@zylker.com"); replyToAddresses.add("brent@zylker.com");
replyToAddresses = "shawn@zylker.com, hailee@zylker.com, brent@zylker.com";
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 types | Subject of the email. | ||||||||
<message> | All data types | Content of the email. | ||||||||
<content_type> (optional) | TEXT | It could be one of the following:
Default value: HTML | ||||||||
<attachments> (optional) | FILE | File fetched using invokeUrl task that needs to be attached with the mail. Note:
The value of this parameter needs to be in the following format.
Allowed formats to send attachments in Zoho Creator:
|
In Zoho Creator, this task can be used in the following events
When a record is Created | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Created or Edited | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Edited | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Deleted | ||
On Validate | Yes | |
On Success | Yes | |
Other workflow events | ||
On a scheduled date | Yes | |
During approval process | Yes | |
During payment process | Yes | |
In a Custom Function | Yes | |
In an Action item in report | Yes |
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.
From To Result 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 theseAny email address Mail will be sent email address other than zoho.adminuserid, zoho.loginuserid, or verified email address Any email address Error while saving variable that contains email address other than zoho.adminuserid, zoho.loginuserid, or verified email address Any email address Error 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.
From To Result zoho.loginuserid or verified email address
(or)
variable that contains any of theseAny email address Mail will be sent email address other than zoho.loginuserid or verified email address Any email address Error while saving variable that contains email address other than zoho.adminuserid, zoho.loginuserid, or verified email address Any email address Error during run time
Examples
1) The following script is a sample snippet of the send mail task.
[
from: zoho.adminuserid
to: "shawn@zylker.com"
cc: "salesmanager@zoho.com"
replyto: "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>"
]
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.
[
from: "Shawn <shawn@zylker.com>"
to: "john@zylker.com"
cc: "salesmanager@zoho.com"
replyto: "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.
[
url: "http://www.thenonlinearpath.com/wp-content/uploads/2016/05/GoodVibesOnly.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.
[
from: zoho.adminuserid
to: input.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'.
[
from: zoho.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'.
[
from: zoho.adminuserid
to: input.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
sendmail
[
from: zoho.adminuserid
to: input.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
]