Search Syntax in Zoho Mail
Zoho Mail provides you multiple options to search your mailbox extensively to locate or get the right set of emails you look for. The search operation can be performed on various parameters and combinations. When using Zoho Mail via REST APIs or when you use the third party integrations to work with Zoho Mail, to search for emails, you need to build and use a String value as the searchKey. The searchKey needs to built in a particular syntax, for the search results to be returned as expected. The various parameters, operators and allowed values for parameters are explained below.
The following table provides the different parameters for which you can pass the search term to get matching results. You can pass the search term with the following parameters in the format parameter:<search value>.
Parameters | Description |
entire | Returns the results that contain the given word anywhere in the email. |
content | Performs the search operation for the given value only within the email content. |
sender | Returns the emails from the specific sender if the complete email address is provided. If the search term is a word (not an email address), the emails with the from address with the word in the username part or the domain part will get returned in the search results. |
to | The emails with the specified email address in the To region of the email is returned. In case the search term is a word, the emails with the To Address with the specified word in the username part or the domain part will get returned |
cc | Same as the parameter To |
subject | Returns the emails, which has the specified word in the Subject of the email |
fileName | Returns the emails which contain the specified word as a part of the Attached Filename. |
fileContent | Returns emails, which have the specified text in the content of the Attached file's content. |
The search text can be included within double quotes for an exact match and search as a phrase.
Ex:
1. entire:Hello::entire:world
This search string returns emails that contain the words Hello and the word World anywhere in the content. The words need not be in the same order.
2. entire:"Hello world"
This search string returns emails that contain the exact phrase "Hello World" in the email in the same way as found within quotes.
Additional Search Criteria:
Along with the above search term, you can specify additional search criteria like folders, labels, attachments, flags, email type and the date and time the email was sent.
Parameter | Allowed Values | Example |
has | The has parameter helps you to further filter the email results. | has:attachment - Emails with attachments has:flags - Flagged emails has:convo - Emails that are a part of conversation |
in | You can include this parameter to search in a specific folder. in:<folder name> | in:Marketing where 'Marketing' is the name of a folder |
label | You can include this parameter to search for emails with a specific tag/ label. in:<label name> | label:payroll where 'payroll' is the name of a label |
fromDate toDate | The parameters fromDate, toDate help you specify a date range to specify the emails from. fromDate:DD-MMM-YYYY | fromDate:12-Sep-2017 |
inclspamtrash | Include this parameter if you want results from your Spam and Trash folders as well while performing a search. inclspamtrash:true | inclspamtrash:true |
groupResult | Include this parameter if you want the search results that are part of the same conversation to be grouped together. This value will be set to false by default. Set the value of the parameter to true if you want to group the emails. | groupResult:true |
Operators:
While including multiple parameters in Search, the different parameters can be combined using the :: operator, and the OR operator.
To pass the search text/ value with a parameter use a single colon - :
For example, if you want to search for emails containing the term 'marketing', it has to be mentioned as entire:marketing.
Operator for mentioning the next condition:
If you want to mention a set of conditions in a single searchKey, you will have to use :: to denote the next condition.
Syntax - ::
Example - entire:payroll::has:attachment
This searchKey returns the emails that contain an attachment and the term payroll in some part of the email.
OR Operator:
Syntax - :or:
Example - sender:frank@zylker.com::or:to:frank@zylker.com
This searchKey lists the emails that are sent or are received from frank@zylker.com.
Note:
If there is no operator mentioned after the :: operator, the AND operation will be performed by default.
searchKey Example:
subject:Bill::sender:customercare@creditcard.com::has:attachment
The above String value passed as searchKey returns the email with the term Bill in the subject that are from customercare@creditcard.com and with attachments.