How to Use Search Operators

When a simple search isn't sufficient, try again with search operators

Person using computer
  Hoxton/Ryan Lees/Getty Images offers a simple search that often is all you need to find the emails you are looking for, but when the search becomes complicated, lets you construct queries using search operators. You can specify senders, subjects and folders, of course, but you can also search by date and date range, look for attachments, and combine operators and terms using "AND" and "OR" and parentheses for precedence and grouping.

How to Use Search Operators

To search for emails in precisely using search operators, click in the Search mail field. Employ the following search operators to construct a query:

  • subject: — searches email subjects. Example: "subject:test" finds emails with "test" in the Subject: line.
  • from: — searches email senders in the From: line. Example: "" finds emails from as well as those from, and other emails that include "" in the From: line.
  • to: — searches email recipients in the To: line. Example: "" finds emails addressed to directly in the To: line.
  • cc: — searches email recipients in the Cc: line. Example: "" finds emails that have in the Cc: line.
  • before: — searches for emails sent or received before the given date.
  • after: — searches for mail sent or received after the given date.
  • date: — searches for mail sent or received on the given date. Using <, <=, >= and &gt, you can search for dates less than (before) and greater than (following) the given date. For before:, after:, and date, specify the date in the form mm/dd/yyyy. Examples: "after:12/31/1997 before:1/1/1999" finds messages sent and received through 1998.
  • folder: — searches mail in the given folder. Example: "folder:archive" finds emails in the archive folder.
  • has:attachment: — searches only mail that has at least one file attached. Examples: "hasattachment:true" and "has:attachment" on its own return all messages containing attachments. 
  • hasattachment:false — searches only messages that have no files attached.
  • AND (uppercase) — combines terms in your search so that both must be present. This is the default if no combination operator is present.

  • OR (uppercase) — combines search terms so that either of them or both suffice.  
  • () - specifies the precedence of search terms.
Was this page helpful?