cfimapfilter

Specifies filter parameters that control the actions of cfimap, get operations.

Two ways to use this tag: [name, value pair attributes] or [name, from, to ].


name = "filter type"
value = "filter value"

OR


name = "filter type"
from = "date/time"
to = "date/time"

  <cfimapfilter name="filter type" ... >

 cfimapfilter(name="filter type", ...);

This tag requires Adobe ColdFusion 11 and up.  Not supported on Lucee, etc.

Attribute Reference

name string
Required

type of imap filter to use. TimeReceived and TimeSent must be used with the from/to attributes
Values:
  • Subject
  • From
  • To
  • Flag
  • TimeReceived
  • TimeSent

from date

The start date or date/time combination of the range to use for filtering. Cannot be used with the value attribute. If you specify a from attribute without a to attribute, the filter selects for all entries on or after the specified date or time.
The value can be in any date/time format recognized by ColdFusion, but must correspond to a value that is appropriate for the filter type.

to date

The end date or date/time combination for the range used for filtering. Cannot be used with the value attribute. If you specify a to attribute without a from attribute, the filter selects for all entries on or before the specified date or time.
The value can be in any date/time format recognized by ColdFusion, but must correspond to a value that is appropriate for the filter type.

value string

Filter Value

Compatibility

ColdFusion:

Version 11+ You can specify this tag's attributes in an attributeCollection attribute whose value is a structure. Specify the structure name in the attributeCollection attribute and use the tag's attribute names as structure keys.

Examples
Sample code using the cfimapfilter tag

<cfimap action="getall" 
 connection = "#REQUEST.connectionname#" 
 name = "queryname" 
 stoponerror = "#REQUEST.stoponerror#" >
 
 <cfimapfilter name="subject" value="filter">
 
</cfimap>

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub